home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / amos-tools / dizzy_clone / dizzy_final.amos / dizzy_final.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1980-12-12  |  66.0 KB  |  2,502 lines

  1. Set Buffer 10
  2.  
  3. Hide On 
  4. Cls 0
  5.  
  6. ' ************************************************************ 
  7. ' * Hi there! Welcome to the final Dizzy clone. This version * 
  8. ' * now includes character interaction, puzzle solving and   * 
  9. ' * collision detection with eniemes.                        * 
  10. ' *                                                          * 
  11. ' * Please Note:                                             * 
  12. ' * I have been forced into removing a LOT of the old        * 
  13. ' * documentation in this version due to VERY limited disk   * 
  14. ' * space. All of the old documentation will be in the       * 
  15. ' * completed game though!                                   * 
  16. ' *                                                          *     
  17. ' * The first one of the FIVE Dizzy clones that we are       * 
  18. ' * working on was supposed to be finished in time for this  * 
  19. ' * issue but due to the amount of mail we received over the * 
  20. ' * Christmas holidays this caused delays. So next issue at  * 
  21. ' * least one of the Dizzy Clones will be complete and       * 
  22. ' * available with the fully documented source code. This    * 
  23. ' * full version should have over 100 locations, lots of     * 
  24. ' * different characters, piles of graphics and cracking     * 
  25. ' * gameplay.                                                * 
  26. ' *                                                          * 
  27. ' * Due to VERY limited disk space I have only managed to    * 
  28. ' * squeeze three different locations onto this issue. To    * 
  29. ' * give you an idea of how to get character interaction     * 
  30. ' * working I have included Dizzy whom you can speak to by   * 
  31. ' * pressing the fire button when standing beside him. As    * 
  32. ' * well as this, in location three you will come across     * 
  33. ' * a roaring fire. To put the fire out you must pour        * 
  34. ' * the bucket of water over it. This is a VERY simple       * 
  35. ' * puzzle but its only there to show you how its done!      * 
  36. ' *                                                          * 
  37. ' * I recommend that all enemies in the game should use      * 
  38. ' * BOBS 1-5. All characters like Dizzy should use           * 
  39. ' * BOBS greater than 10.  I have changed the entire         * 
  40. ' * graphics around for this issue just for a change         * 
  41. ' * and to show you how easy it is to produce a different    * 
  42. ' * game with the same source code.                          * 
  43. ' *                                                          * 
  44. ' * Scan this source code with care as you will find I       * 
  45. ' * have added the odd routine here and there to get         * 
  46. ' * everything working proberly. A lot of the new            * 
  47. ' * routines have been added to the end of this source       * 
  48. ' * code to make life easier for you.                        * 
  49. ' * Thats all - Wait and see the full working version        * 
  50. ' * which will have a full introduction and be of            * 
  51. ' * commercial quality!                                      * 
  52. ' ************************************************************ 
  53.  
  54.  
  55. 'If Length(6)=0
  56.  
  57. 'Track Load "mr amos club issue 2:amos_programs_by_mr_amos/dizzytune.tracker",6
  58.  
  59. 'Track Play 6 : Rem tell AMOS to start playing the tune thats in bank 6
  60.  
  61. 'Track Loop On : Rem tell AMOS that when the tune reaches the end - restart it automatically!    
  62.  
  63. 'End If  
  64.  
  65.  
  66.  
  67. CHEAT=0
  68.  
  69.  
  70. WALK_GRID=0 : Rem Set this to 1 if you want to the hidden grid where Charlie can walk on and bump into!!!  
  71. FULL_GRID=0 : Rem Set this to 1 if you want a full grid
  72.  
  73.  
  74. Dim LADDER_ANIMATIONS(4)
  75.  
  76. LADDER_ANIMATIONS(1)=17
  77. LADDER_ANIMATIONS(2)=18
  78. LADDER_ANIMATIONS(3)=19
  79. LADDER_ANIMATIONS(4)=18
  80.  
  81.  
  82.  
  83.  
  84. Dim WINGS_ANIMATION_FRAME(4)
  85.  
  86. WINGS_ANIMATION_FRAME(1)=21
  87. WINGS_ANIMATION_FRAME(2)=22
  88. WINGS_ANIMATION_FRAME(3)=23
  89. WINGS_ANIMATION_FRAME(4)=22
  90.  
  91. ' *************************************************************  
  92. ' * This is four new variables that I have added to the game! *  
  93. ' *************************************************************  
  94.  
  95. LIVES=3 : Rem Stores the amount of lives that Charlie has
  96. COINS=0 : Rem Stores the amount of coins that Charlie has
  97. SCORE=0 : Rem This is Charlies score 
  98. _AMOUNT_OF_ENERGY_LEFT=47 : Rem This is the MAXIMUM amount of energy 
  99.  
  100. Dim POCKET(3) : Rem This will hold the numbers of the objects that Charlie is carrying 
  101.  
  102. POCKET(1)=0 : Rem Nothing
  103. POCKET(2)=0 : Rem Nothing
  104. POCKET(3)=0 : Rem Nothing
  105.  
  106. AMOUNT_OF_OBJECTS=11 : Rem Just set this to the amount of objects that you will have in your game 
  107.  
  108. Dim OBJECT_NAME$(AMOUNT_OF_OBJECTS) : Rem Stores the names of all our in game objects
  109. Dim OBJECT_CURRENT_LOCATION(AMOUNT_OF_OBJECTS) : Rem This will hold the number of the location that the object is currently in during the game
  110. Dim OBJECT_X_OFFSET(AMOUNT_OF_OBJECTS) : Rem This is an X offset for the object so that it sits perfectly in place as they are not all the same size
  111. Dim OBJECT_Y_OFFSET(AMOUNT_OF_OBJECTS) : Rem This is an Y offset for the object so that it sits perfectly in place as they are not all the same size
  112. Dim OBJECT_CURRENT_X_COARDINATE(AMOUNT_OF_OBJECTS) : Rem This is the current X coardinate of the object on screen during the game - Must be diviable by 16 - eg. 16,32,48,64,80,96,112,128..... 
  113. Dim OBJECT_CURRENT_Y_COARDINATE(AMOUNT_OF_OBJECTS) : Rem This is the current Y coardinate of the object on screen during the game - Must be diviable by 16 - eg. 16,32..... 
  114. Dim OBJECT_SPRITE_IMAGE(AMOUNT_OF_OBJECTS) : Rem This is the image from the sprite bank that we will use to show the object on screen 
  115.  
  116. ' *******************************************************************
  117. ' * This next load of information stores all the DATA for           *
  118. ' * the objects in our game.                                        *      
  119. ' *                                                                 *
  120. ' * The first piece of text is the object name which can            *
  121. ' * be no longer than 20 characters in length as it will            *
  122. ' * be too long for the inventory window.                           *    
  123. ' *                                                                 *
  124. ' * The first number is the current location of the object..        *  
  125. ' * The second number is the objects X offset.                      *    
  126. ' * The third number is the objects Y offset.                       *
  127. ' * The fourth number is the X coardinate of the object on screen.  *
  128. ' * The fifth number is the Y coardinate of the object on screen.   *
  129. ' * The sixth number is the Sprite bank image of the object.        *
  130. ' *******************************************************************
  131.  
  132. Restore OBJECT_DATA : Rem Tell AMOS to start reading the DATA from label OBJECT_DATA 
  133.  
  134. For N=1 To AMOUNT_OF_OBJECTS
  135.  
  136. Read OBJECT_NAME$(N)
  137. Read OBJECT_CURRENT_LOCATION(N)
  138. Read OBJECT_X_OFFSET(N)
  139. Read OBJECT_Y_OFFSET(N)
  140. Read OBJECT_CURRENT_X_COARDINATE(N)
  141. Read OBJECT_CURRENT_Y_COARDINATE(N)
  142. Read OBJECT_SPRITE_IMAGE(N)
  143.  
  144. Next N
  145.  
  146. OBJECT_DATA:
  147. Data "BOOK OF THE DEAD",12,-3,-2,64,160,90
  148. Data "PAIR OF SUNGLASSES",9,-2,7,224,160,91
  149. Data "A CANDLE",1,2,-6,96,160,92
  150. Data "A GOLD RING",2,0,-1,192,160,93
  151. Data "A SILVER RING",4,0,-1,128,160,94
  152. Data "A LEATHER JACKET",2,0,-3,112,160,95
  153. Data "A POTION BOTTLE",3,0,-2,128,160,96
  154. Data "A DAGGER",4,-2,3,96,160,97
  155. Data "PAIR OF LEATHER BOOTS",11,-1,-1,224,160,98
  156. Data "A GOLDEN CROWN",12,-1,-1,128,160,99
  157. Data "A BUCKET OF WATER",1,-3,0,64,160,100
  158.  
  159.  
  160. ' *********************************************************
  161. ' * This is a new bit I have added. Its were we store all *
  162. ' * of the different messages that are used in the game.  *
  163. ' *********************************************************
  164.  
  165. ' ****************************************************************** 
  166. ' * The first number in the data stores the number of the message. * 
  167. ' * I have only included this so that it makes it easier for you   * 
  168. ' * to find a particular message pretty fast.                      * 
  169. ' *                                                                * 
  170. ' * The second number stores the width of the message window.      * 
  171. ' * The third number stores the height of the message window.      * 
  172. ' * The fourth number stores the X position of the message window. * 
  173. ' * The fifth number stores the Y position of the message window.  * 
  174. ' *                                                                * 
  175. ' * Once these numbers have been read in, the program will then    *   
  176. ' * continue to read in data until it comes across the word "end"  * 
  177. ' * which signals the end of the message.                          * 
  178. ' *                                                                * 
  179. ' * This way means we can have different lines of text within      * 
  180. ' * the one message.                                               * 
  181. ' *                                                                * 
  182. ' * The two numbers store the X and Y coardinate of the line       * 
  183. ' * of text thats beside it.                                       * 
  184. ' ****************************************************************** 
  185.  
  186.  
  187. MESSAGE_DATA:
  188. Data 1,176,32,64,70
  189. Data 16,16,"MY HANDS ARE FULL!"
  190. Data 0,0,"end"
  191.  
  192. Data 2,208,32,48,70
  193. Data 16,16,"I CAN'T CARRY ANY MORE!"
  194. Data 0,0,"end"
  195.  
  196. Data 3,176,32,64,70
  197. Data 16,11,"MY MUSCLES ARE NOT"
  198. Data 16,22,"  STRONG ENOUGH!  "
  199. Data 0,0,"end"
  200.  
  201. Data 4,144,32,80,128
  202. Data 16,11,"CHOOSE ITEM TO"
  203. Data 16,22,"SELECT OR DROP"
  204. Data 0,0,"end"
  205.  
  206. Data 5,224,32,40,62
  207. Data 16,11,"      HELLO DIZZY!"
  208. Data 16,22,"WHAT ARE YOU DOING HERE?"
  209. Data 0,0,"end"
  210.  
  211. Data 6,256,64,20,40
  212. Data 16,11,"WHAT AM I DOING HERE YOU ASK!"
  213. Data 16,22,"  WHAT ARE YOU DOING HERE?"
  214. Data 16,33," "
  215. Data 16,44,"   I SHOULD BE STARING IN"
  216. Data 16,55,"     THIS GAME NOT YOU!"
  217. Data 0,0,"end"
  218.  
  219. Data 7,186,80,56,40
  220. Data 16,11,"DON'T BE SO JEALOUS!"
  221. Data 16,22,"    YOU EGGHEAD!"
  222. Data 16,33," "
  223. Data 16,44," EVERYBODY IS SICK"
  224. Data 16,55,"   LOOKING AT YOU"
  225. Data 16,66,"SO I AM TAKING OVER!"
  226. Data 0,0,"end"
  227.  
  228. Data 8,144,32,80,62
  229. Data 16,11,"  GAME OVER!"
  230. Data 16,22,"REST IN PEACE!"
  231. Data 0,0,"end"
  232.  
  233. Data 9,170,64,68,40
  234. Data 14,15,"YOU POUR THE WATER"
  235. Data 14,26," OVER THE FIRE AND"
  236. Data 14,37,"  THE FLAMES ARE "
  237. Data 14,48," QUICKLY QUENCHED!"
  238. Data 0,0,"end"
  239.  
  240. Data 10,202,64,52,40
  241. Data 10,15,"  OH GO AWAY CHARLIE!"
  242. Data 14,26,"I DON'T WANT TO SPEAK"
  243. Data 14,37,"    TO YOU ANYMORE!"
  244. Data 14,48,"  YOU MAKE ME SICK!!"
  245. Data 0,0,"end"
  246.  
  247.  
  248.  
  249.  
  250. If Length(1)=0 Then Load "CHARLIE_CHIMP.ABK"
  251.  
  252.  
  253. If Length(2)=0 Then Load "ICONS.ABK" : Rem Is there any ICONS in memory?
  254.  
  255.  
  256.  
  257. If Length(8)=0
  258.  
  259. FILE$="MAC_5.MAP"
  260.  
  261.  
  262. If Exist(FILE$) : Rem Does the file exist? 
  263.  
  264. Open In 1,FILE$ : Rem Open up the file for scanning
  265.  
  266. THE_LENGTH=Lof(1) : Rem This gets the size of the file 
  267.  
  268. Close 1 : Rem Close the file again 
  269.  
  270. Erase 6 : Rem Get rid of anything thats lying in bank number 6 
  271.  
  272. Reserve As Data 6,THE_LENGTH : Rem Make bank number 6 the same length as the MAP file size
  273.  
  274. Bload FILE$,Start(6) : Rem Load the MAP file/data into bank number 6 - which is the same size. This is where our MAP will be stored throughout the game.
  275.  
  276.  
  277.  
  278. If Exist(FILE$+".VAL") : Rem Is there any VALUES knocking about? - Yes - then load them in as well!!
  279.  
  280. Load FILE$+".VAL" : Rem Load the VALUES in.  
  281.  
  282. Else 
  283.  
  284. Erase 8 : Rem Get rid of anything thats lying in bank number 8   
  285.  
  286. Reserve As Data 8,4000 : Rem Make bank number 8 - 4000 bytes long - as thats the same size as our VALUE bank. 
  287.  
  288. End If 
  289.  
  290.  
  291. If Exist(FILE$+".EFF") : Rem Is there any EFFECTS knocking about? - Yes - then load them in as well!! 
  292.  
  293. Load FILE$+".EFF" : Rem Load the EFFECTS in.     
  294.  
  295. Else 
  296.  
  297. Erase 10 : Rem Get rid of anything thats lying in bank number 10    
  298.  
  299. Reserve As Data 10,Length(6)/2 : Rem Make bank number 10 - half the length of the MAP as it uses bytes not words
  300.  
  301. End If 
  302.  
  303. End If 
  304.  
  305. End If 
  306.  
  307.  
  308.  
  309.  
  310.  
  311. If Length(10)=0 Then Load "SCOREPICTURE.ABK"
  312.  
  313.  
  314.  
  315.  
  316. XMAPSIZE=Deek(Start(6))
  317. YMAPSIZE=Deek(Start(6)+2)
  318.  
  319.  
  320. LOCATIONS_IN_MAP=(XMAPSIZE/20)*(YMAPSIZE/12) : Rem This line works out how many different locations there are in the MAP
  321.  
  322. LOCATION=1 : Rem this variable holds the number of the current location that Charlie is in at any time - we start him at location 1 
  323.  
  324. ' ***********************************************************************
  325. ' * This next line resets ALL effects switchs in the game. Although its *
  326. ' * of no use in this demo and you will need MEGA MAC MAP to use them.  *
  327. ' ***********************************************************************
  328.  
  329. For COUNTER=0 To Length(10)
  330. If Peek(Start(10)+COUNTER)>0 and Peek(Start(10)+COUNTER)<100 Then Poke Start(10)+COUNTER,Peek(Start(10)+COUNTER)+100
  331. Next COUNTER
  332.  
  333. ' *******************************************  
  334. ' * This next lot sets up the triggers that *
  335. ' * will be used to tell wheter or not a    *
  336. ' * location has any SETUP, PUZZLE CHECKING *
  337. ' * or DETECTION CHECKING in it.            *
  338. ' *******************************************  
  339.  
  340. Dim LOCATION_NAME$(LOCATIONS_IN_MAP) : Rem These variables will store the location names
  341.  
  342. Dim LOCATION_SETUP_TRIGGERS(LOCATIONS_IN_MAP) : Rem These variables will stores triggers that tell us wheter or not a particular location needs a setup stage
  343.  
  344. Dim LOCATION_PUZZLE_CHECKING_TRIGGERS(LOCATIONS_IN_MAP) : Rem These variables will stores triggers that tell us wheter or not a particular location needs a puzzle checking stage  
  345.  
  346. Dim LOCATION_DETECTION_CHECKING_TRIGGERS(LOCATIONS_IN_MAP) : Rem These variables will stores triggers that tell us wheter or not a particular location needs a detection checking stage 
  347.  
  348.  
  349. Restore LOCATION_DATA : Rem This sets the READ pointer so that it starts reading the data from this label name 
  350.  
  351.  
  352. For COUNTER=1 To LOCATIONS_IN_MAP
  353.  
  354. Read LOCATION_NAME$(COUNTER) : Rem This stores the name of each location
  355. Read LOCATION_SETUP_TRIGGERS(COUNTER) : Rem This stores the trigger that tells us wheter the location has a setup stage ( a '1' or a '0' ) 
  356. Read LOCATION_PUZZLE_CHECKING_TRIGGERS(COUNTER) : Rem This stores the trigger that tells us wheter the location has a puzzle checking stage ( a '1' or a '0' )   
  357. Read LOCATION_DETECTION_CHECKING_TRIGGERS(COUNTER) : Rem This stores the trigger that tells us wheter the location has a detection checking stage ( a '1' or a '0' )  
  358.  
  359. Next COUNTER
  360.  
  361. ' *************************************************
  362. ' * This is the actual location data and triggers *
  363. ' *************************************************
  364.  
  365. LOCATION_DATA:
  366. Data "   ROOM NUMBER ONE  ",1,0,1
  367. Data "   ROOM NUMBER TWO  ",1,0,0
  368. Data "  ROOM NUMBER THREE ",1,1,0
  369. Data "   ROOM NUMBER FOUR ",0,0,0
  370. Data "   ROOM NUMBER FIVE ",0,0,0
  371. Data "   ROOM NUMBER SIX  ",0,0,0
  372. Data "  ROOM NUMBER SEVEN ",0,0,0
  373. Data "  ROOM NUMBER EIGHT ",0,0,0
  374. Data "   ROOM NUMBER NINE ",1,0,0
  375. Data "   ROOM NUMBER TEN  ",0,0,0
  376. Data " ROOM NUMBER ELEVEN ",1,0,0
  377. Data " ROOM NUMBER TWELVE ",1,0,0
  378. Data "ROOM NUMBER THIRTEEN",0,0,0
  379. Data "ROOM NUMBER FOURTEEN",0,0,0
  380.  
  381.  
  382.  
  383. Unpack 11 To 1
  384.  
  385. Screen Hide 1 : Rem Hide the screen
  386.  
  387. For N=0 To 31 : Colour N,$0 : Next N : Rem Turn all the colours to black
  388.  
  389. Gosub _UPDATE_LIVES : Rem Print the amount of lives
  390. Gosub _UPDATE_SCORE : Rem Print the starting score - 000000
  391. Gosub _UPDATE_COINS : Rem Print the amount of coins
  392.  
  393. Screen 1
  394.  
  395. Paste Bob 195,38,24 : Rem This is the energy bar 
  396.  
  397. ROOMNAME$=LOCATION_NAME$(LOCATION) : Gosub ROOMNAMEPRINT : Rem Print the current location name
  398.  
  399. Screen Show 1 : Wait Vbl 
  400.  
  401.  
  402. Screen Open 0,320,192,32,Lowres : Rem open the screen
  403. Flash Off : Paper 0 : Curs Off : Cls 0 : Hide On : Rem Tidy it up 
  404. Get Sprite Palette : Rem get the proper colours 
  405. Colour 1,$0
  406. Screen Display 0,,100,, : Rem Display the screen underneath our Score screen 
  407. For N=0 To 31 : Colour N,$0 : Next N : Rem Turn all the colours to black
  408.  
  409. Double Buffer : Rem Set up Double buffer to stop the flickering
  410. Autoback 0 : Rem Set the double buffer mode to 0 - which is the fastest mode
  411. Bob Update Off : Rem Tell AMOS not to automatically update the bobs on screen as we are going to do it ourselves as its more flexible!
  412. Wait Vbl : Rem Wait a 50th of a second  
  413.  
  414. Cls 0 : Rem clear the screen with colour zero
  415.  
  416. ' ********************************************   
  417. ' * I have added a nice rainbow for the sky. * 
  418. ' ******************************************** 
  419.  
  420. Restore _RAINBOW_DATA
  421.  
  422. Set Rainbow 0,1,240,"","",""
  423. Rainbow 0,0,96,240
  424. For C=0 To 190
  425. Read CVA
  426. Rain(0,C)=CVA
  427. Next C
  428.  
  429. _RAINBOW_DATA:
  430. Data $300,$500,$500,$600,$600,$600,$700,$700,$700
  431. Data $800,$800,$800,$900,$900,$900,$A00,$A00,$A00,$B00
  432. Data $B00,$B00,$B00,$B00,$C00,$C00,$D00,$D00,$E10,$E10
  433. Data $E10,$F10,$F20,$F30,$F30,$F40,$F40,$F50,$F60,$F60
  434. Data $F70,$F70,$F80,$F90,$F90,$FA0,$FA0,$FB0,$FC0,$FC0
  435. Data $FD0,$FD0,$FE0,$FF0,$FF0,$FF0,$EF0,$EF0,$DF0,$DF0
  436. Data $DF0,$CF0,$CF0,$BF0,$BF0,$BF0,$AF0,$AF0,$9F0,$9F0
  437. Data $9F0,$8F0,$8F0,$8F0,$8F0,$7F0,$7F0,$7F0,$7F0,$6F0
  438. Data $6F0,$6F0,$4F0,$3F0,$2F0,$2F0,$2F0,$2F0,$2F0,$2F0
  439. Data $2F0,$2F0,$2F0,$2F0,$2F0,$F0,$F0,$F0,$F0,$F0
  440. Data $F0,$F1,$F1,$F2,$F3,$F3,$F4,$F4,$F5,$F6
  441. Data $F6,$F7,$F7,$F8,$F9,$F9,$FA,$FA,$FB,$FC
  442. Data $FC,$FD,$FD,$FE,$FF,$EF,$DF,$DF,$CF,$BF
  443. Data $BF,$AF,$AF,$9F,$8F,$8F,$7F,$7F,$6F,$5F
  444. Data $5F,$4F,$4F,$3F,$2F,$2F,$2F,$2F,$1F,$F
  445. Data $E,$D,$D,$D,$D,$D,$C,$C,$C,$C
  446. Data $B,$B,$B,$B,$B,$B,$A,$A,$A,$A
  447. Data $A,$A,$9,$9,$9,$9,$9,$8,$8,$8
  448. Data $8,$8,$7,$7,$7,$7,$6,$6,$6,$6
  449. Data $5,$5,$5,$5,$4,$4,$4,$3,$3,$3
  450.  
  451. Set Bob 15,1,, : Rem This sets bob 15 so that the area underneath it won't be saved in memoer once its drawen as we are going to be constantly redrawing the background anyway!   
  452.  
  453. ' **************************************************************************** 
  454. ' * Ok - this is another screen I have opened which will contain an exact    * 
  455. ' * copy of the current location.                                            * 
  456. ' **************************************************************************** 
  457.  
  458. Screen Open 2,320,192,32,Lowres : Rem open up the screen 
  459. Flash Off : Paper 0 : Curs Off : Cls 0 : Rem tidy it up 
  460. Screen Hide 2 : Rem Hide it from view!!
  461.  
  462. ' ***********************************************************
  463. ' * This FADE routine will fade in the score/energy screen. *
  464. ' ***********************************************************
  465.  
  466. Screen 1
  467. Fade 2,$0,$7F,$200,$999,$360,$111,$666,$555,$830,$7,$27,$594,$20,$444,$222,$4F,$EEE,$70B,$A0F,$F3F,$333,$FF1,$F90,$1F,$E98,$D54,$B40,$831,$620,$510,$310,$0
  468. Wait 28
  469. Screen 0
  470.  
  471. Gosub ANEWLOCATION : Rem this line jumps to the routine that will draw our location graphics on the screen
  472.  
  473. SPEED=4 : Rem Controls the speed of movement by Charlie:- Try changing it to -2  and he'll walk backwards  
  474.  
  475. ' *********************************************************
  476. ' * This is used by the program to determine what Charlie *
  477. ' *               is doing at any time.                   *
  478. ' *                                                       *
  479. ' *         Status=1 means he is walking right            *  
  480. ' *         Status=2 means he is walking left             *
  481. ' *       Status=3 means he is standing facing you        *
  482. ' *********************************************************
  483.  
  484. STATUS=1 : Rem Controls what Charlie is currently doing - the program starts with Charlie facing you' 
  485.  
  486. CHARLIEX=124 : Rem X coardinate of Charlie on the screen
  487.  
  488. CHARLIEY=142 : Rem Y coardinate of Charlie on the screen
  489.  
  490.  
  491. CURRENTANIMATIONFRAME=13 : Rem Start the program with Charlie standing facing you!
  492.  
  493.  
  494. SPEEDOFCHARLIEANIMATIONS=2 : Rem This is the actual animation speed 
  495. CHARLIEANIMATIONCOUNTER=0 : Rem This is the delay counter used by the program to determine wheter or not to change to current animation
  496.  
  497.  
  498. STANDSTILLCOUNTER=0 : Rem Used to find out if its time to make Charlie face you
  499. FOOTTAPCOUNTER=0 : Rem This is the counter for Charlies footapping  
  500. FOOTTAPSPEED=6 : Rem Tap Charlie's foot every six loops 
  501.  
  502.  
  503. JUMPCOUNTER=0 : Rem this is used for counting the height that Charlie has jumped 
  504. JUMPHEIGHT=SPEED*12 : Rem this is the height that Charlie will jump - set it to anything you like! 
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517. ' **********************************   
  518. ' * This is the programs main loop * 
  519. ' ********************************** 
  520.  
  521. MAIN:
  522.  
  523.  
  524. Screen Copy 2 To 0 : Rem Copy the entire contents of hidden screen 2 - to game screen 0   
  525.  
  526.  
  527.  
  528. If CHEAT=0
  529.  
  530.  
  531. If DIE=0
  532.  
  533.  
  534. If LADDER=0
  535.  
  536.  
  537. STANDSTILLCOUNTER=STANDSTILLCOUNTER+1
  538.  
  539.  
  540.  
  541. If Jright(1) and STATUS<>1 : Rem Has the player pressed the joystick right for the first time 
  542.  
  543. STATUS=1 : Rem Set the program to handle Charlie walking to the right 
  544. CURRENTANIMATIONFRAME=1 : Rem Set the CURRENTANIMATIONFRAME to the first one in the walking to right images
  545. CHARLIEANIMATIONCOUNTER=0 : Rem Reset the animation counter to zero
  546.  
  547. End If 
  548.  
  549.  
  550. If Jright(1) and STATUS=1 : Rem Is the player constantly holding the joystick right
  551.  
  552.  
  553. STANDSTILLCOUNTER=0 : Rem Reset the standstillcounter to zero - this is so that Charlie does'nt start footapping while he is walking 
  554. STATUS=1 : Rem Let the program know that Charlie is now walking to the right
  555.  
  556.  
  557.  
  558. If CHARLIEX>304
  559. LOCATION=LOCATION+1
  560. CHARLIEX=0
  561. Gosub ANEWLOCATION
  562. End If 
  563.  
  564.  
  565.  
  566. _BOTTOM_RIGHT_X=((CHARLIEX+24)/16)
  567. _BOTTOM_RIGHT_Y=(CHARLIEY+33)/16
  568. _MAP_POSITION=(X_MAP+_BOTTOM_RIGHT_X)+((Y_MAP+_BOTTOM_RIGHT_Y)*XMAPSIZE)
  569.  
  570. CHECKING_ICON1=Deek(Start(6)+4+(_MAP_POSITION)*2)
  571. CHECKING_ICON2=Deek(Start(6)+4+(_MAP_POSITION-XMAPSIZE)*2)
  572.  
  573. _EFFECT=Peek(Start(10)+_MAP_POSITION)
  574.  
  575. If _EFFECT>100
  576. Screen 2
  577. Print At(0,0);"YOU HAVE HIT AN EFFECT BLOCK!!"
  578. Print At(0,1);"ITS NUMBER IS - ";_EFFECT;" "
  579. Poke(Start(10)+_MAP_POSITION),_EFFECT-100
  580. Screen 0
  581. End If 
  582.  
  583. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON facing Charlies head 
  584. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem This stores the value of the ICON facing Charlies feet 
  585.  
  586.  
  587. If(_VALUE1=50 or _VALUE2=50)
  588.  
  589. CHARLIEX=CHARLIEX-SPEED
  590.  
  591. _OFFSET=SPEED
  592.  
  593. Else 
  594.  
  595. CHARLIEX=CHARLIEX+SPEED
  596.  
  597. _OFFSET=0
  598.  
  599. End If 
  600.  
  601.  
  602.  
  603.  
  604. CHARLIEANIMATIONCOUNTER=CHARLIEANIMATIONCOUNTER+1 : Rem This measures the delay time between each animation frame
  605.  
  606. If CHARLIEANIMATIONCOUNTER=SPEEDOFCHARLIEANIMATIONS : Rem Has the current animation speed been reached yet?
  607. CHARLIEANIMATIONCOUNTER=0 : Rem Reset it 
  608. CURRENTANIMATIONFRAME=CURRENTANIMATIONFRAME+1 : Rem Next animation 
  609.  
  610.  
  611. If CURRENTANIMATIONFRAME=7 : Rem Is it time to loop back around yet?  
  612. CURRENTANIMATIONFRAME=1 : Rem Change it back to one
  613. End If 
  614.  
  615. End If 
  616.  
  617.  
  618. End If 
  619.  
  620.  
  621. If Jleft(1) and STATUS<>2 : Rem Has the player press the jostick left for the first time 
  622.  
  623. STATUS=2 : Rem Set the program to handle Charlie walking to the left  
  624. CURRENTANIMATIONFRAME=7 : Rem Set the CURRENTANIMATIONFRAME to the first one in the walking to left images 
  625. CHARLIEANIMATIONCOUNTER=0 : Rem Reset the animation counter to zero
  626.  
  627. End If 
  628.  
  629.  
  630. If Jleft(1) and STATUS=2 : Rem Is the player constantly holding the joystick left 
  631.  
  632.  
  633. STANDSTILLCOUNTER=0 : Rem Reset the standstillcounter to zero - this is so that Charlie does'nt start footapping while he is walking 
  634. STATUS=2 : Rem Let the program know that Charlie is now walking to the left 
  635.  
  636.  
  637. If CHARLIEX<-4
  638. LOCATION=LOCATION-1
  639. CHARLIEX=304
  640. Gosub ANEWLOCATION
  641. End If 
  642.  
  643.  
  644.  
  645. _BOTTOM_LEFT_X=((CHARLIEX-4)/16)
  646. _BOTTOM_LEFT_Y=(CHARLIEY+33)/16
  647. _MAP_POSITION=(X_MAP+_BOTTOM_LEFT_X)+((Y_MAP+_BOTTOM_LEFT_Y)*XMAPSIZE)
  648.  
  649. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  650. CHECKING_ICON2=Deek(Start(6)+4+(_MAP_POSITION-XMAPSIZE)*2)
  651.  
  652. _EFFECT=Peek(Start(10)+_MAP_POSITION)
  653.  
  654. If _EFFECT>100
  655. Screen 2
  656. Print At(0,0);"YOU HAVE HIT AN EFFECT BLOCK!!"
  657. Print At(0,1);"ITS NUMBER IS - ";_EFFECT;" "
  658. Poke(Start(10)+_MAP_POSITION),_EFFECT-100
  659. Screen 0
  660. End If 
  661.  
  662. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON facing Charlie head
  663. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem This stores the value of the ICON facing Charlies feet 
  664.  
  665.  
  666. If(_VALUE1=50 or _VALUE2=50)
  667.  
  668. CHARLIEX=CHARLIEX+SPEED
  669.  
  670. _OFFSET=-SPEED
  671.  
  672. Else 
  673.  
  674. CHARLIEX=CHARLIEX-SPEED
  675.  
  676. _OFFSET=0
  677.  
  678. End If 
  679.  
  680.  
  681. CHARLIEANIMATIONCOUNTER=CHARLIEANIMATIONCOUNTER+1 : Rem This measures the delay time between each animation frame
  682.  
  683. If CHARLIEANIMATIONCOUNTER=SPEEDOFCHARLIEANIMATIONS : Rem Has the current animation speed been reached yet?
  684. CHARLIEANIMATIONCOUNTER=0 : Rem Reset it 
  685. CURRENTANIMATIONFRAME=CURRENTANIMATIONFRAME+1 : Rem Next animation 
  686.  
  687.  
  688. If CURRENTANIMATIONFRAME=13 : Rem Is it time to loop back around yet?  
  689. CURRENTANIMATIONFRAME=7 : Rem Change it back to seven
  690. End If 
  691.  
  692. End If 
  693.  
  694.  
  695. End If 
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702. If FALLING=0 and JUMPING=0
  703.  
  704. _BOTTOM_LEFT_X=(CHARLIEX/16)
  705. _BOTTOM_RIGHT_X=((CHARLIEX+20)/16)
  706. _BOTTOM_Y=(CHARLIEY+34)/16
  707.  
  708. _MAP_POSITION=(X_MAP+_BOTTOM_LEFT_X)+((Y_MAP+_BOTTOM_Y)*XMAPSIZE)
  709. _MAP_POSITION2=(X_MAP+_BOTTOM_RIGHT_X)+((Y_MAP+_BOTTOM_Y)*XMAPSIZE)
  710.  
  711. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  712. CHECKING_ICON2=Deek(Start(6)+4+_MAP_POSITION2*2)
  713.  
  714. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON thats underneath the left side of Charlie
  715. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem This stores the value of the ICON thats underneath the right side of Charlie 
  716.  
  717.  
  718. If(_VALUE1<50 and _VALUE2<50)
  719.  
  720. FALLING=1
  721.  
  722. End If 
  723.  
  724. End If 
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732. If Jdown(1)
  733.  
  734.  
  735. If(JUMPING=0 and FALLING=0)
  736.  
  737. PRESSED_DOWN=1 : Rem This tells the ladder checking routine that it is to check for a ladder underneath Charlie 
  738. PRESSED_UP=0
  739.  
  740. Gosub CHECK_FOR_LADDER : Rem jump to the checking routine!
  741.  
  742. End If 
  743.  
  744. End If 
  745.  
  746.  
  747.  
  748.  
  749. If Jup(1) : Rem has joystick been pressed up?
  750.  
  751.  
  752.  
  753.  
  754. PRESSED_UP=1 : Rem This tells the ladder checking routine to check for a ladder above Charlie 
  755. PRESSED_DOWN=0
  756.  
  757. Gosub CHECK_FOR_LADDER : Rem Jump to the checking routine 
  758.  
  759.  
  760.  
  761. If FALLING=0 and JUMPING=0 : Rem is Charlie NOT already jumping or falling? 
  762.  
  763. JUMPING=1 : Rem tell the program that Charlie is jumping 
  764.  
  765. JUMPCOUNTER=JUMPHEIGHT : Rem this sets the JUMPCOUNTER to the height that Charlie can jump.  This will be decremented until it reaches 0 and this is how the program knows when to stop jumping!  
  766.  
  767.  
  768. If STATUS=3
  769. STATUS=STATUS_BACKUP : Rem this is here in case he is tapping his foot  
  770. End If 
  771.  
  772. End If 
  773.  
  774. End If 
  775.  
  776.  
  777.  
  778.  
  779. If JUMPING=1 : Rem is Charlie currently jumping?
  780.  
  781. STANDSTILLCOUNTER=0 : Rem he can't tap his foot in mid air so reset the counter! 
  782.  
  783.  
  784.  
  785.  
  786. If(CHARLIEY+2) mod 16=0
  787.  
  788. _LEFT_X=((CHARLIEX)/16)
  789. _RIGHT_X=((CHARLIEX+20)/16)
  790. _TOP_Y=(CHARLIEY-4)/16
  791.  
  792. _MAP_POSITION=(X_MAP+_LEFT_X)+((Y_MAP+_TOP_Y)*XMAPSIZE)
  793. _MAP_POSITION2=(X_MAP+_RIGHT_X)+((Y_MAP+_TOP_Y)*XMAPSIZE)
  794.  
  795. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  796. CHECKING_ICON2=Deek(Start(6)+4+_MAP_POSITION2*2)
  797.  
  798. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem Stores the value of the ICON to the top left of Charlie  
  799. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem Stores the value of the ICON to the top right of Charlie 
  800.  
  801. If(_VALUE1=50 or _VALUE2=50)
  802.  
  803. JUMPCOUNTER=0
  804.  
  805. Else 
  806.  
  807. CHARLIEY=CHARLIEY-SPEED : Rem this bit moves Charlie up into the air!  
  808. JUMPCOUNTER=JUMPCOUNTER-SPEED : Rem this counts how high Charlie has jumped by taking the speed away from the height that he is allowed to jump - once JUMPCOUNTER reaches 0 it stops jumping!     
  809.  
  810.  
  811.  
  812. If CHARLIEY<-6
  813.  
  814. LOCATION=LOCATION-XMAPSIZE/20
  815. CHARLIEY=162
  816. Gosub ANEWLOCATION
  817.  
  818. End If 
  819.  
  820. End If 
  821.  
  822. Else 
  823.  
  824. CHARLIEY=CHARLIEY-SPEED : Rem this bit moves Charlie up into the air!  
  825. JUMPCOUNTER=JUMPCOUNTER-SPEED : Rem this counts how high Charlie has jumped by taking the speed away from the height that he is allowed to jump - once JUMPCOUNTER reaches 0 it stops jumping!     
  826.  
  827. End If 
  828.  
  829.  
  830. If JUMPCOUNTER=0 : Rem has Charlie reached the maximum jump height - if he has then set the program to start falling by setting the variable FALLING to 1 
  831. JUMPING=0 : Rem turn off jumping 
  832. FALLING=1 : Rem turn on falling
  833. End If 
  834.  
  835.  
  836. If STATUS=1 : Rem is he facing right 
  837. CURRENTANIMATIONFRAME=15 : Rem Image for facing to the right when jumping!
  838. End If 
  839.  
  840.  
  841. If STATUS=2 : Rem is he facing left
  842. CURRENTANIMATIONFRAME=16 : Rem image for facing to the left when jumping! 
  843. End If 
  844.  
  845. End If 
  846.  
  847.  
  848.  
  849. If FALLING=1 : Rem is Charlie currently falling?
  850.  
  851. STANDSTILLCOUNTER=0 : Rem he can't tap his foot in mid air so reset the counter! 
  852. CHARLIEY=CHARLIEY+SPEED : Rem this bit moves Charlie down until it reaches the ground again! 
  853. JUMPCOUNTER=JUMPCOUNTER+SPEED : Rem this counts how far Charlie has falled by adding the speed to JUMPCOUNTER - once JUMPCOUNTER reaches JUMPHEIGHT it stops falling!    
  854.  
  855.  
  856. If STATUS=1 : Rem is he facing right 
  857. CURRENTANIMATIONFRAME=15 : Rem Image for facing to the right when jumping!
  858. End If 
  859.  
  860.  
  861. If STATUS=2 : Rem is he facing left
  862. CURRENTANIMATIONFRAME=16 : Rem image for facing to the left when jumping! 
  863. End If 
  864.  
  865.  
  866. If(CHARLIEY+2) mod 16=0
  867.  
  868. _BOTTOM_LEFT_X=((CHARLIEX)/16)
  869. _BOTTOM_RIGHT_X=((CHARLIEX+20)/16)
  870. _BOTTOM_Y=(CHARLIEY+38)/16
  871.  
  872. _MAP_POSITION=(X_MAP+_BOTTOM_LEFT_X)+((Y_MAP+_BOTTOM_Y)*XMAPSIZE)
  873. _MAP_POSITION2=(X_MAP+_BOTTOM_RIGHT_X)+((Y_MAP+_BOTTOM_Y)*XMAPSIZE)
  874.  
  875. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  876. CHECKING_ICON2=Deek(Start(6)+4+_MAP_POSITION2*2)
  877.  
  878. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem Stores the value of the ICON to the bottom left of Charlie 
  879. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem Stores the value of the ICON to the bottom right of Charlie
  880.  
  881. If(_VALUE1>49 or _VALUE2>49)
  882.  
  883. FALLING=0 : Rem if he has then turn off the falling routine
  884. CHARLIEANIMATIONCOUNTER=0 : Rem We have to reset this variable back to 0 so that the walk left and right routine works proberly  
  885.  
  886.  
  887. If STATUS=1
  888. CURRENTANIMATIONFRAME=1 : Rem if Charlie is facing right then when he lands he should be facing right and standing!
  889. End If 
  890.  
  891. If STATUS=2
  892. CURRENTANIMATIONFRAME=7 : Rem if Charlie is facing left then when he lands he should be facing left and standing!
  893. End If 
  894.  
  895. End If 
  896.  
  897.  
  898. If CHARLIEY>174
  899. LOCATION=LOCATION+XMAPSIZE/20
  900. CHARLIEY=-2
  901. Gosub ANEWLOCATION
  902. End If 
  903.  
  904.  
  905. End If 
  906.  
  907. End If 
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923. If STANDSTILLCOUNTER>1 : Rem Has Charlie not moved for a while
  924.  
  925. If STATUS<3
  926. STATUS_BACKUP=STATUS : Rem This stores the direction Charlie was facing 
  927. End If 
  928.  
  929. STATUS=3 : Rem Tell the program that its currently foottapping
  930. FOOTTAPCOUNTER=FOOTTAPCOUNTER+1 : Rem This measures the amount of time delay for each animation for the foottapping bit
  931.  
  932. If FOOTTAPCOUNTER=12 : Rem This checks the footapping counter - After foot has been raised and has stayed on the screen for a bit it then has to go back down again 
  933. FOOTTAPCOUNTER=0 : Rem Reset the footapping counter to zero   
  934. End If 
  935.  
  936. If FOOTTAPCOUNTER<FOOTTAPSPEED : Rem This works out the time delay for the foot animation on the ground 
  937. CURRENTANIMATIONFRAME=13 : Rem This is the image to use from the sprite bank for the foot on the ground 
  938. End If 
  939.  
  940. If FOOTTAPCOUNTER>=FOOTTAPSPEED : Rem This works out the time delay for the foot raised
  941. CURRENTANIMATIONFRAME=14 : Rem This is the image to use from the sprite bank for the foot raised
  942. End If 
  943.  
  944. End If 
  945.  
  946.  
  947. If Fire(1) : Rem Has fire been pressed? 
  948.  
  949. If JUMPING=0 and FALLING=0 and STATUS=3 : Rem Check to see that he is not jumping or falling 
  950.  
  951. If _AMOUNT_OF_LOOPS_IN_LOCATION>3 : Rem This just makes sure Charlie is on the screen when ever the inventory screen is called - It prevents a little BUG in the program!! 
  952. Gosub INVENTORY : Rem Jump to the routine that handles the INVENTORY 
  953. End If 
  954.  
  955. End If 
  956.  
  957. End If 
  958.  
  959.  
  960.  
  961.  
  962. Else 
  963.  
  964.  
  965.  
  966.  
  967. Gosub CLIMB_LADDER : Rem Jumps to the routine that handles Charlie climbing ladders 
  968.  
  969. End If : Rem this is the end of the ladder check
  970.  
  971.  
  972. Else 
  973.  
  974.  
  975.  
  976. Gosub DEAD : Rem Jumps to the routine that handles Charlie dieing - The Angel 
  977.  
  978. End If : Rem this is the end of the die check 
  979.  
  980. End If : Rem this is the end of the CHEAT=0 check 
  981.  
  982.  
  983.  
  984. If CHEAT=1 Then Gosub CHEAT_CHECKS
  985.  
  986.  
  987.  
  988. Bob 15,CHARLIEX+_OFFSET,CHARLIEY,CURRENTANIMATIONFRAME
  989.  
  990.  
  991.  
  992. Bob Draw 
  993.  
  994. ' **************************************************************** 
  995. ' * This is the command that checks for Charlie colliding with   * 
  996. ' * any monsters or other bobs that take energy of him. Any BOBS * 
  997. ' * in the game that use numbers 1-5 will take effect.           * 
  998. ' ****************************************************************   
  999.  
  1000. If Bob Col(15,1 To 5) Then Gosub _UPDATE_ENERGY : Rem If he collides with a monster the jump to the routine that deducts energy!   
  1001.  
  1002. ' ***********************************************
  1003. ' * Every four game loops (To save on speed) we *  
  1004. ' * check things like key press'es etc.         *
  1005. ' ***********************************************
  1006.  
  1007.  
  1008. Add _FRAME_COUNTER,1,1 To 4
  1009.  
  1010.  
  1011. If _FRAME_COUNTER=4
  1012.  
  1013.  
  1014. If Inkey$<>"" : Gosub _KEY_CHECKS : End If : Rem Has any keys been pressed? 
  1015.  
  1016. If Mouse Key=1 : DIE=1 : End If : Rem Has the mouse key been pressed?
  1017.  
  1018. ' *****************************************************************  
  1019. ' * If you want to know Charlies X and Y coardinates at any time  *
  1020. ' * in the game - just press the RIGHT mouse key. This will allow *
  1021. ' * you to work out where any detection zones should be on the    *
  1022. ' * screen like I have done with the Dizzy Character!             *
  1023. ' *****************************************************************
  1024.  
  1025. If Mouse Key=2
  1026.  
  1027. Screen 2
  1028.  
  1029. Print At(0,0);"CHARLIE X=";CHARLIEX;" "
  1030. Print At(0,1);"CHARLIE Y=";CHARLIEY;" "
  1031.  
  1032. Screen 0
  1033.  
  1034. End If 
  1035.  
  1036.  
  1037.  
  1038. If FALLING=0 and JUMPING=0
  1039.  
  1040. If DIE=0
  1041.  
  1042. SAFE_LOCATION=LOCATION : Rem Stores the safe location 
  1043. SAFE_SPOT_X=CHARLIEX : Rem Stores the safe X coardinates
  1044. SAFE_SPOT_Y=CHARLIEY : Rem Stores the safe Y coardinates  
  1045.  
  1046. End If 
  1047.  
  1048. End If 
  1049.  
  1050. End If 
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057. Screen Swap 
  1058.  
  1059. Inc _AMOUNT_OF_LOOPS_IN_LOCATION : Rem This is used to tell how long Charlie has been in a certain location!
  1060.  
  1061. Wait Vbl 
  1062.  
  1063.  
  1064. Goto MAIN
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079. _KEY_CHECKS:
  1080.  
  1081. If Key State(95) Then CHEAT=1 : Screen 2 : Print At(0,0);"CHEAT MODE ON " : Screen 0
  1082. If Key State(70) Then CHEAT=0 : Screen 2 : Print At(0,0);"CHEAT MODE OFF" : Screen 0
  1083.  
  1084. Return 
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097. DEAD:
  1098.  
  1099. CHARLIEY=CHARLIEY-SPEED/2 : Rem Move him up the screen by decrementing his Y coardinates 
  1100.  
  1101. CURRENTANIMATIONFRAME=20 : Rem This is the number of the image of the Angel body in the sprite bank 
  1102.  
  1103.  
  1104.  
  1105. Bob 14,CHARLIEX+_OFFSET-2,CHARLIEY+12,WINGS_ANIMATION_FRAME(WING_ANIMATION_COUNTER)
  1106.  
  1107.  
  1108.  
  1109. Inc WING_SPEED_COUNTER : Rem This controls the animation speed of the wings 
  1110.  
  1111.  
  1112. If WING_SPEED_COUNTER=3 : Rem Change the wing animation every 3 frames 
  1113.  
  1114. Inc WING_ANIMATION_COUNTER : Rem This counter is used with controling the actual images of the wings
  1115.  
  1116.  
  1117. If WING_ANIMATION_COUNTER=5 : Rem  If is equal to 5 then reset it to 1 
  1118.  
  1119. WING_ANIMATION_COUNTER=1 : Rem Reset it to 1
  1120.  
  1121. End If 
  1122.  
  1123.  
  1124. WING_SPEED_COUNTER=0 : Rem Reset the wind speed animation counter 
  1125.  
  1126. End If 
  1127.  
  1128.  
  1129.  
  1130.  
  1131. If CHARLIEY<-36
  1132.  
  1133. Bob Off 14 : DIE=0
  1134.  
  1135. LIVES=LIVES-1
  1136.  
  1137.  
  1138. Gosub _UPDATE_LIVES : Rem Jump to the routine that prints the amount of lives
  1139.  
  1140. Screen 1
  1141. Paste Bob 195,38,24 : Rem This is the energy bar resetting 
  1142. Screen 0
  1143.  
  1144. LOCATION=SAFE_LOCATION : Rem put him in the safe location 
  1145. CHARLIEX=SAFE_SPOT_X : Rem put him at the safe X coardinates
  1146. CHARLIEY=SAFE_SPOT_Y : Rem put him at the safe Y coardinates
  1147. JUMPING=0 : Rem Stop any jumping 
  1148. FALLING=0 : Rem Stop any falling 
  1149. LADDER=0 : Rem Take him off the ladder
  1150. STATUS=3 : Rem Make him face you tapping his foot 
  1151.  
  1152. Gosub ANEWLOCATION : Rem Redraw the location
  1153.  
  1154. End If 
  1155.  
  1156. Return 
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163. CHEAT_CHECKS:
  1164.  
  1165. If Jleft(1) and X_MAP+CHARLIEX>0 : CHARLIEX=CHARLIEX-SPEED : End If 
  1166. If Jright(1) and X_MAP+((CHARLIEX+32)/16)<XMAPSIZE : CHARLIEX=CHARLIEX+SPEED : End If 
  1167. If Jup(1) and Y_MAP+CHARLIEY>0 : CHARLIEY=CHARLIEY-SPEED : End If 
  1168. If Jdown(1) and Y_MAP+((CHARLIEY+54)/16)<YMAPSIZE : CHARLIEY=CHARLIEY+SPEED : End If 
  1169.  
  1170. If CHARLIEX>304 : LOCATION=LOCATION+1 : CHARLIEX=0 : Gosub ANEWLOCATION : End If 
  1171. If CHARLIEX<-4 : LOCATION=LOCATION-1 : CHARLIEX=304 : Gosub ANEWLOCATION : End If 
  1172.  
  1173. If CHARLIEY>174
  1174.  
  1175. If(Y_MAP+12)<YMAPSIZE
  1176. CHARLIEY=-2
  1177. LOCATION=LOCATION+(XMAPSIZE/20) : Gosub ANEWLOCATION
  1178. End If 
  1179.  
  1180. End If 
  1181.  
  1182. If CHARLIEY<-6
  1183.  
  1184. If Y_MAP>11
  1185. CHARLIEY=162
  1186. LOCATION=LOCATION-(XMAPSIZE/20) : Gosub ANEWLOCATION
  1187. End If 
  1188.  
  1189. End If 
  1190.  
  1191.  
  1192. If Key State(78)
  1193.  
  1194. If X_MAP+20<XMAPSIZE
  1195.  
  1196. LOCATION=LOCATION+1 : Gosub ANEWLOCATION
  1197.  
  1198. End If 
  1199.  
  1200. End If 
  1201.  
  1202. If Key State(79)
  1203.  
  1204. If X_MAP>0
  1205.  
  1206. LOCATION=LOCATION-1 : Gosub ANEWLOCATION
  1207.  
  1208. End If 
  1209.  
  1210. End If 
  1211.  
  1212. If Key State(77)
  1213.  
  1214. If(Y_MAP+12)<YMAPSIZE
  1215. LOCATION=LOCATION+(XMAPSIZE/20) : Gosub ANEWLOCATION
  1216. End If 
  1217.  
  1218. End If 
  1219.  
  1220.  
  1221. If Key State(76)
  1222.  
  1223. If Y_MAP>11
  1224. LOCATION=LOCATION-(XMAPSIZE/20) : Gosub ANEWLOCATION
  1225. End If 
  1226.  
  1227. End If 
  1228.  
  1229. Return 
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236. CHECK_FOR_LADDER:
  1237.  
  1238.  
  1239.  
  1240. If(JUMPING=1 or FALLING=1)
  1241. _CENTRE_X=((CHARLIEX)/16)
  1242. Else 
  1243. _CENTRE_X=((CHARLIEX+16)/16)
  1244. End If 
  1245.  
  1246.  
  1247.  
  1248. If PRESSED_UP=1
  1249. _BOTTOM_CENTRE_Y=(CHARLIEY+16)/16
  1250. End If 
  1251.  
  1252.  
  1253. If PRESSED_DOWN=1
  1254. _BOTTOM_CENTRE_Y=(CHARLIEY+38)/16
  1255. End If 
  1256.  
  1257.  
  1258.  
  1259. _MAP_POSITION=(X_MAP+_CENTRE_X)+((Y_MAP+_BOTTOM_CENTRE_Y)*XMAPSIZE)
  1260.  
  1261. CHECKING_ICON1=Deek(Start(6)+4+(_MAP_POSITION)*2)
  1262. CHECKING_ICON2=Deek(Start(6)+4+(_MAP_POSITION-1)*2)
  1263.  
  1264. _VALUE1=Peek(Start(8)+CHECKING_ICON1)
  1265. _VALUE2=Peek(Start(8)+CHECKING_ICON2)
  1266.  
  1267.  
  1268.  
  1269. If(_VALUE1=10 or _VALUE2=10) and(JUMPING=0 and FALLING=0)
  1270.  
  1271. If _VALUE1=10
  1272. CHARLIEX=((CHARLIEX/16)*16)+16 : Rem Put Charlie on the ladder
  1273. End If 
  1274.  
  1275. If _VALUE2=10
  1276. CHARLIEX=((CHARLIEX/16)*16) : Rem Put Charlie on the ladder
  1277. End If 
  1278.  
  1279. LADDER=1 : Rem Tell the rest of the program that Charlies on a LADDER!! 
  1280.  
  1281. LADDER_ANIMATION_COUNTER=1 : Rem Reset the climbing animation counter 
  1282.  
  1283. _OFFSET=-3 : Rem This is used to centre Charlie up on the ladder
  1284.  
  1285. End If 
  1286.  
  1287.  
  1288.  
  1289.  
  1290. If _VALUE1=10 and(JUMPING=1 or FALLING=1)
  1291.  
  1292. CHARLIEX=((CHARLIEX/16)*16) : Rem Put Charlie on the ladder
  1293.  
  1294. JUMPING=0 : Rem Turn off jumping 
  1295. FALLING=0 : Rem Turn off falling 
  1296.  
  1297. LADDER=1 : Rem Tell the rest of the program that Charlies on a ladder 
  1298.  
  1299. LADDER_ANIMATION_COUNTER=1 : Rem Reset the climbing animation counter 
  1300.  
  1301. _OFFSET=-3 : Rem This is used to centre Charlie up on the ladder
  1302.  
  1303. End If 
  1304.  
  1305. Return 
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317. CLIMB_LADDER:
  1318.  
  1319. Inc _TIME_ON_THE_LADDER : Rem This is a little timer that I put in. All it does is makes sure Charlie stays on the ladder long enough for you to see him on it. - Just in case you jump off again immediately
  1320.  
  1321. CURRENTANIMATIONFRAME=LADDER_ANIMATIONS(LADDER_ANIMATION_COUNTER) : Rem This makes sure Charlie (bob 15) uses the climb animations 
  1322.  
  1323.  
  1324. If Jup(1)
  1325.  
  1326.  
  1327.  
  1328. _BOTTOM_X=((CHARLIEX+8)/16)
  1329. _BOTTOM_Y=(CHARLIEY+20)/16
  1330.  
  1331. _MAP_POSITION=(X_MAP+_BOTTOM_X)+((Y_MAP+_BOTTOM_Y)*XMAPSIZE)
  1332.  
  1333. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  1334.  
  1335. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON
  1336.  
  1337.  
  1338.  
  1339.  
  1340. If _VALUE1=10
  1341.  
  1342. CHARLIEY=CHARLIEY-4 : Rem Move Charlie up the ladder!
  1343.  
  1344. Inc LADDER_ANIMATION_SPEED : Rem This controls the speed of the climbing animations 
  1345.  
  1346.  
  1347. If CHARLIEY<-6
  1348.  
  1349. LOCATION=LOCATION-XMAPSIZE/20
  1350. CHARLIEY=174
  1351. Gosub ANEWLOCATION
  1352.  
  1353. End If 
  1354.  
  1355.  
  1356.  
  1357.  
  1358. If LADDER_ANIMATION_SPEED>1
  1359.  
  1360. Inc LADDER_ANIMATION_COUNTER
  1361. LADDER_ANIMATION_SPEED=0
  1362.  
  1363. End If 
  1364.  
  1365.  
  1366. End If 
  1367.  
  1368. End If 
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377. If Jdown(1)
  1378.  
  1379.  
  1380. _BOTTOM_X=((CHARLIEX+8)/16)
  1381. _BOTTOM_Y=(CHARLIEY+38)/16
  1382.  
  1383. _MAP_POSITION=(X_MAP+_BOTTOM_X)+((Y_MAP+_BOTTOM_Y)*XMAPSIZE)
  1384.  
  1385. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  1386.  
  1387. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON
  1388.  
  1389.  
  1390.  
  1391.  
  1392. If _VALUE1=10
  1393.  
  1394. CHARLIEY=CHARLIEY+4 : Rem Move Charlie down the ladder 
  1395.  
  1396. Dec LADDER_ANIMATION_SPEED : Rem Controls the animation speed 
  1397.  
  1398.  
  1399. If CHARLIEY>174
  1400.  
  1401. LOCATION=LOCATION+XMAPSIZE/20
  1402. CHARLIEY=-10
  1403. Gosub ANEWLOCATION
  1404.  
  1405. End If 
  1406.  
  1407.  
  1408. If LADDER_ANIMATION_SPEED<0
  1409.  
  1410. Dec LADDER_ANIMATION_COUNTER
  1411. LADDER_ANIMATION_SPEED=1
  1412.  
  1413. End If 
  1414.  
  1415. End If 
  1416.  
  1417.  
  1418. End If 
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424. If Jright(1) and _TIME_ON_THE_LADDER>4
  1425.  
  1426.  
  1427. _BOTTOM_RIGHT_X=((CHARLIEX+24)/16)
  1428. _BOTTOM_RIGHT_Y=(CHARLIEY+36)/16
  1429. _MAP_POSITION=(X_MAP+_BOTTOM_RIGHT_X)+((Y_MAP+_BOTTOM_RIGHT_Y)*XMAPSIZE)
  1430.  
  1431. CHECKING_ICON1=Deek(Start(6)+4+(_MAP_POSITION)*2)
  1432. CHECKING_ICON2=Deek(Start(6)+4+(_MAP_POSITION-XMAPSIZE)*2)
  1433. CHECKING_ICON3=Deek(Start(6)+4+(_MAP_POSITION-XMAPSIZE-XMAPSIZE)*2)
  1434.  
  1435. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON facing Charlies head 
  1436. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem This stores the value of the ICON facing Charlies feet 
  1437. _VALUE3=Peek(Start(8)+CHECKING_ICON3) : Rem This stores the value of the ICON facing Charlies feet 
  1438.  
  1439.  
  1440. If(_VALUE1=0 and _VALUE2=0 and _VALUE3=0)
  1441.  
  1442. _TIME_ON_THE_LADDER=0
  1443.  
  1444. LADDER=0 : STATUS=1 : FALLING=1 : JUMPING=0 : CURRENTANIMATIONFRAME=1 : CHARLIEX=CHARLIEX+8
  1445.  
  1446. End If 
  1447.  
  1448. End If 
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455. If Jleft(1) and _TIME_ON_THE_LADDER>4
  1456.  
  1457. _TIME_ON_THE_LADDER=0
  1458.  
  1459. _BOTTOM_LEFT_X=((CHARLIEX-4)/16)
  1460. _BOTTOM_LEFT_Y=(CHARLIEY+36)/16
  1461. _MAP_POSITION=(X_MAP+_BOTTOM_LEFT_X)+((Y_MAP+_BOTTOM_LEFT_Y)*XMAPSIZE)
  1462.  
  1463. CHECKING_ICON1=Deek(Start(6)+4+_MAP_POSITION*2)
  1464. CHECKING_ICON2=Deek(Start(6)+4+(_MAP_POSITION-XMAPSIZE)*2)
  1465. CHECKING_ICON3=Deek(Start(6)+4+(_MAP_POSITION-XMAPSIZE-XMAPSIZE)*2)
  1466.  
  1467. _VALUE1=Peek(Start(8)+CHECKING_ICON1) : Rem This stores the value of the ICON facing Charlie head
  1468. _VALUE2=Peek(Start(8)+CHECKING_ICON2) : Rem This stores the value of the ICON facing Charlies feet 
  1469. _VALUE3=Peek(Start(8)+CHECKING_ICON3) : Rem This stores the value of the ICON facing Charlies feet 
  1470.  
  1471.  
  1472. If _VALUE1=0 and _VALUE2=0 and _VALUE3=0
  1473.  
  1474. LADDER=0 : STATUS=2 : FALLING=1 : JUMPING=0 : CURRENTANIMATIONFRAME=7 : CHARLIEX=CHARLIEX-12
  1475.  
  1476. End If 
  1477.  
  1478. End If 
  1479.  
  1480.  
  1481.  
  1482. If LADDER_ANIMATION_COUNTER>4 Then LADDER_ANIMATION_COUNTER=1
  1483. If LADDER_ANIMATION_COUNTER<1 Then LADDER_ANIMATION_COUNTER=4
  1484.  
  1485. Return 
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497. ' ************************************************************** 
  1498. ' * The following LABELS hold the setup details of each of the * 
  1499. ' * different locations in the game.                           * 
  1500. ' ************************************************************** 
  1501.  
  1502. ' ****************************** 
  1503. ' * The details for location 1 *   
  1504. ' ****************************** 
  1505.  
  1506. LOCATIONSETUP1:
  1507.  
  1508.  
  1509. ' ************************** 
  1510. ' * This bit sets up Dizzy * 
  1511. ' ************************** 
  1512.  
  1513. Channel 11 To Bob 11 : Rem this is the channel that Dizzy will use  
  1514. Bob 11,165,155, : Rem the bear is BOB number 2 - place it at X coard 265 - Y coard 150 
  1515.  
  1516. DIZZY$="Anim 0,(40,8)(41,7);" : Rem animations for Dizzy 
  1517.  
  1518. Amal 11,DIZZY$ : Rem tell channel number 2 to control the DIZZY$ string 
  1519. Amal On 11 : Rem turn in on!
  1520.  
  1521. Wait Vbl 
  1522. Return 
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530. ' ****************************** 
  1531. ' * The details for location 2 *   
  1532. ' ****************************** 
  1533.  
  1534. LOCATIONSETUP2:
  1535.  
  1536. ' *************************************************  
  1537. ' * This is how we set up some birds in the game! *  
  1538. ' *************************************************  
  1539.  
  1540. NUMBER_OF_BIRD=1 : XBIRD=300 : YBIRD=80 : BIRD_DIRECTION=-1
  1541. BIRD_ANIMATION_START=34 : BIRD_UP_DOWN=1
  1542. BIRD_SPEED=1 : BIRD_ANIMATION_SPEED=6
  1543.  
  1544. Gosub SET_UP_A_BIRD
  1545.  
  1546. NUMBER_OF_BIRD=2 : XBIRD=5 : YBIRD=10 : BIRD_DIRECTION=1
  1547. BIRD_ANIMATION_START=34 : BIRD_UP_DOWN=1
  1548. BIRD_SPEED=1 : BIRD_ANIMATION_SPEED=6
  1549.  
  1550. Gosub SET_UP_A_BIRD
  1551.  
  1552. Return 
  1553.  
  1554.  
  1555.  
  1556. ' ****************************** 
  1557. ' * The details for location 3 *   
  1558. ' ****************************** 
  1559.  
  1560. LOCATIONSETUP3:
  1561.  
  1562. ' *********************************************************  
  1563. ' * These lines jump to the routine that sets up a Fire!  *  
  1564. ' * just give it an animation channel(NUMBEROFFIRE) ,     *  
  1565. ' * and an X and Y coardinate(XFIRE and YFIRE and then    *  
  1566. ' * call the SETUPAFIRE routine                           *  
  1567. ' *********************************************************  
  1568.  
  1569. If _FIRE_PUZZLE_SOLVED=0
  1570.  
  1571. NUMBEROFFIRE=1 : XFIRE=180 : YFIRE=160 : Gosub SETUPAFIRE
  1572. NUMBEROFFIRE=2 : XFIRE=214 : YFIRE=160 : Gosub SETUPAFIRE
  1573. Wait Vbl 
  1574.  
  1575. End If 
  1576.  
  1577. Return 
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592. ' ****************************************************************** 
  1593. ' * The following LABELS hold the detection details of each of the * 
  1594. ' * different locations in the game.                               * 
  1595. ' ****************************************************************** 
  1596.  
  1597. ' ****************************** 
  1598. ' * The details for location 1 *   
  1599. ' ****************************** 
  1600.  
  1601.  
  1602. LOCATION_DETECTION1:
  1603.  
  1604. If CHARLIEX>=148 and CHARLIEX<=188 : Rem Is Charlie standing beside Dizzy?
  1605.  
  1606. Freeze : Rem Freeze all the action
  1607. Bob Draw : Rem Update all bobs in their latest positions on the screen
  1608.  
  1609. If ALREADY_SPOKE_TO_DIZZY=0 : Rem Has Dizzy been spoken to yet!
  1610.  
  1611. MESSAGE=5 : Gosub MESSAGE_PRINTER
  1612. MESSAGE=6 : Gosub MESSAGE_PRINTER
  1613. MESSAGE=7 : Gosub MESSAGE_PRINTER
  1614.  
  1615. ALREADY_SPOKE_TO_DIZZY=1 : Rem Tell the program that we have talked to Dizzy
  1616.  
  1617. Else 
  1618.  
  1619. MESSAGE=10 : Gosub MESSAGE_PRINTER
  1620.  
  1621. End If 
  1622.  
  1623. Gosub MESSAGE_END : Rem Remove the last message window 
  1624.  
  1625. CHECKED_DETECTION=1 : Rem This tells us that a detection has been made so don't call the inventory window
  1626.  
  1627. End If 
  1628.  
  1629. Return 
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635. ' **********************************************   
  1636. ' * The puzzle checking details for location 3 *     
  1637. ' **********************************************   
  1638.  
  1639.  
  1640. LOCATION_PUZZLE_CHECKING3:
  1641.  
  1642. If CHARLIEX>=152 and CHARLIEX<=252 : Rem Is Charlie standing near the flames? 
  1643.  
  1644. If POCKET(POCKET_EMPTIED)=11 : Rem Is the object the bucket of water? Ie object number 11 
  1645.  
  1646. OBJECT_CURRENT_LOCATION(POCKET(POCKET_EMPTIED))=255 : Rem Place the object out of the game as its no longer needed 
  1647.  
  1648. POCKET(POCKET_EMPTIED)=0 : Rem empty the pocket 
  1649.  
  1650. PUZZLE_SOLVED=1 : Rem Tell the program that the puzzle has been solved 
  1651.  
  1652. _FIRE_PUZZLE_SOLVED=1
  1653.  
  1654. Freeze : Rem Freeze all the action
  1655. Bob Draw : Rem Update all bobs in their latest positions on the screen
  1656.  
  1657. MESSAGE=9 : Gosub MESSAGE_PRINTER : Rem Print the YOU PUT THE FLAMES OUT message on the screen 
  1658.  
  1659. ' ***********************************************************************
  1660. ' * Now that the puzzle has been solved - we just remove the fire bobs! *
  1661. ' ***********************************************************************
  1662.  
  1663. Bob 1,-500,500,
  1664. Bob 2,-500,500,
  1665.  
  1666. Gosub MESSAGE_END : Rem This ends the message and removes the window from the screen 
  1667.  
  1668. End If 
  1669.  
  1670. End If 
  1671.  
  1672. Return 
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683. ' *********************************************************
  1684. ' * This AMAL string will setup a flying monster for you! *
  1685. ' *********************************************************
  1686.  
  1687.  
  1688. SET_UP_A_BIRD:
  1689.  
  1690. Channel NUMBER_OF_BIRD To Bob NUMBER_OF_BIRD : Rem set up the channel 
  1691.  
  1692. Set Bob NUMBER_OF_BIRD,1,,
  1693.  
  1694. Bob NUMBER_OF_BIRD,XBIRD,YBIRD, : Rem place it on the screen 
  1695.  
  1696.       BIRD$="If R1=-1 Jump label D;"
  1697. BIRD$=BIRD$+"label A:Anim 0,(R3,R5)(R3+1,R5)(R3+2,R5)(R3+1,R5);If R4=1 Jump label C;" : Rem animations for the bird facing right 
  1698. BIRD$=BIRD$+"label B:Pause;Let R4=2;Let X=X+R2;If X>300 Jump label D;Let Y=Y+R2;If Y>148 Jump label C;Jump label B;"
  1699. BIRD$=BIRD$+"label C:Pause;Let R4=1;Let X=X+R2;If X>300 Jump label D;Let Y=Y-R2;If Y<0 Jump label B;Jump label C;"
  1700. BIRD$=BIRD$+"label D:Anim 0,(R3+3,R5)(R3+4,R5)(R3+5,R5)(R3+4,R5);If R4=1 Jump label F;" : Rem animations for the bird facing left  
  1701. BIRD$=BIRD$+"label E:Pause;Let R4=2;Let X=X-R2;If X<0 Jump label A;Let Y=Y+R2;If Y>148 Jump label F;Jump label E;"
  1702. BIRD$=BIRD$+"label F:Pause;Let R4=1;Let X=X-R2;If X<0 Jump label A;Let Y=Y-R2;If Y<0 Jump label E;Jump label F;"
  1703.  
  1704. Amal NUMBER_OF_BIRD,BIRD$ : Rem Set up the AMAL string for the bird
  1705.  
  1706. Amreg(NUMBER_OF_BIRD,1)=BIRD_DIRECTION
  1707. Amreg(NUMBER_OF_BIRD,2)=BIRD_SPEED
  1708. Amreg(NUMBER_OF_BIRD,3)=BIRD_ANIMATION_START
  1709. Amreg(NUMBER_OF_BIRD,4)=BIRD_UP_DOWN
  1710. Amreg(NUMBER_OF_BIRD,5)=BIRD_ANIMATION_SPEED
  1711.  
  1712. Amal On NUMBER_OF_BIRD : Rem turn in on!
  1713.  
  1714. Return 
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722. ' ******************************************** 
  1723. ' * This routine will set up a fire if you   * 
  1724. ' * give it the proper details. The          * 
  1725. ' * variable NUMBEROFFIRE holds the channel  * 
  1726. ' * number 1-14 as Charlie is number 15.     * 
  1727. ' * XFIRE and YFIRE hold the X and Y         * 
  1728. ' * position of it on the screen.            * 
  1729. ' ******************************************** 
  1730.  
  1731. SETUPAFIRE:
  1732. Channel NUMBEROFFIRE To Bob NUMBEROFFIRE : Rem set up the channel 
  1733.  
  1734. Set Bob NUMBEROFFIRE,1,,
  1735. Bob NUMBEROFFIRE,XFIRE,YFIRE, : Rem place it on the screen 
  1736.  
  1737. Amal NUMBEROFFIRE,"Anim 0,(108,7)(109,7)(110,7);" : Rem tell it what to do - ie animate the torch graphics!
  1738. Amal On NUMBEROFFIRE : Rem turn in on!
  1739.  
  1740. Return 
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755. ANEWLOCATION:
  1756.  
  1757.  
  1758.  
  1759. If LOCATION>LOCATIONS_IN_MAP Then LOCATION=LOCATIONS_IN_MAP
  1760. If LOCATION<1 Then LOCATION=1
  1761.  
  1762. Fade 1
  1763. Wait 1 : Rem Fade the screen off    
  1764. Rainbow 0,0,296,240 : Rem This will hide the rainbow by placing it below the screen
  1765. Wait 1
  1766.  
  1767. Bob Off 15 : Rem Remove Charlie(BOB 15) from the screen!
  1768.  
  1769. Amal Off : Rem Turn ALL previous AMAL channels off! 
  1770.  
  1771.  
  1772.  
  1773. Gosub THE_LOCATION_PICTURE_MAKER
  1774.  
  1775. Screen Copy 2 To Physic(0) : Rem Update the new game display screen with our new background 
  1776. Screen Copy 2 To Logic(0) : Rem Update the new display screen with our new background
  1777.  
  1778.  
  1779. For N=1 To 14
  1780. Bob N,-500,-500,
  1781. Next N
  1782.  
  1783. ' ************************************************************************ 
  1784. ' * This next line jumps to the routine that sets up the details for the * 
  1785. ' * current location if there is any!!                                   * 
  1786. ' ************************************************************************ 
  1787.  
  1788. If LOCATION_SETUP_TRIGGERS(LOCATION)=1
  1789.  
  1790. Gosub "LOCATIONSETUP"+Str$(LOCATION)-" "
  1791.  
  1792. End If 
  1793.  
  1794.  
  1795. Set Bob 15,1,, : Rem Turn of Charlies BOB background saving in memory for extar speed 
  1796.  
  1797. Rainbow 0,0,96,240 : Rem Put the rainbow back on the screen 
  1798.  
  1799. Fade 1 To -1 : Rem This line will fade the screen in using the SPRITE BANK palette. Just use -1 
  1800.  
  1801. _AMOUNT_OF_LOOPS_IN_LOCATION=0 : Rem This is just something I added in case you want to measure how long Charlie has been in a particular location!!
  1802.  
  1803. ROOMNAME$=LOCATION_NAME$(LOCATION) : Gosub ROOMNAMEPRINT
  1804.  
  1805. 'Print At(0,10);LOCATION : Rem Replace this line if you wish to know what the number of the location is that your currently in 
  1806.  
  1807. Return 
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822. THE_LOCATION_PICTURE_MAKER:
  1823.  
  1824. Screen 2 : Rem Draw all following graphics in screen 2
  1825.  
  1826.  
  1827. LOCATION_TO_DRAW=(LOCATION-1) : Rem This line works out where the location starts in the map   
  1828.  
  1829. X_SCREENS=XMAPSIZE/20 : Rem This tells us how many screens in width our MAP is   
  1830.  
  1831. Y_SCREENS=YMAPSIZE/12 : Rem This tells us how many screens in height our MAP is
  1832.  
  1833. X_MAP=(LOCATION_TO_DRAW mod X_SCREENS)*20 : Rem This line works out the X positon of the location in the MAP 
  1834.  
  1835. Y_MAP=(LOCATION_TO_DRAW/X_SCREENS)*12 : Rem This line works out the Y position of the location in the MAP
  1836.  
  1837.  
  1838.  
  1839. For YCOUNTER=0 To 11 : Rem Our screen is 12 16*16 tiles in height 
  1840.  
  1841. COUNTER=0 : Rem This is a counter variable 
  1842.  
  1843.  
  1844. For XCOUNTER=0 To 319 Step 16 : Rem Our screen is 20 16*16 Tiles in width
  1845.  
  1846.  
  1847. WHAT=Deek(Start(6)+(4+X_MAP*2+COUNTER+XMAPSIZE*(YCOUNTER+Y_MAP)*2))+1
  1848.  
  1849. Paste Icon XCOUNTER,YCOUNTER*16,WHAT
  1850.  
  1851.  
  1852.  
  1853. If FULL_GRID=1
  1854.  
  1855. Paste Bob XCOUNTER,YCOUNTER*16,27 : Rem Put a full grid on the screen  
  1856.  
  1857. End If 
  1858.  
  1859.  
  1860.  
  1861. If WALK_GRID=1
  1862.  
  1863. If Peek(Start(8)+WHAT-1)>0
  1864.  
  1865. Paste Bob XCOUNTER,YCOUNTER*16,27
  1866.  
  1867. End If 
  1868.  
  1869. End If 
  1870.  
  1871.  
  1872. COUNTER=COUNTER+2 : Rem This is used to tell us which icon is currently being drawen   
  1873.  
  1874.  
  1875. Next XCOUNTER : Rem Continue the loop 2
  1876.  
  1877. Next YCOUNTER : Rem Continue loop 1
  1878.  
  1879.  
  1880. Gosub DISPLAY_OBJECTS_IN_LOCATION : Rem This line jumps to the routine that will place any objects that are in the new location on the screen
  1881.  
  1882.  
  1883. Screen 0 : Rem All future output to screen 0
  1884.  
  1885.  
  1886. Return 
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897. ' ***************************************************************************  
  1898. ' * This next bit handles Charlies INVENTORY (thats the stuff hes carrying!)*  
  1899. ' ***************************************************************************  
  1900.  
  1901. INVENTORY:
  1902.  
  1903. Freeze : Wait Vbl : Rem Freeze all the action
  1904.  
  1905. Bob Draw : Rem Place all bobs in thier latest positions 
  1906. Screen Swap : Wait Vbl : Rem Show the hidden display  
  1907. Screen Copy Physic(0) To Logic(0) : Rem Make sure both Double buffer screens look the same 
  1908.  
  1909. ' ***********************************************************************  
  1910. ' * This next line jumps to the routine that checks for any detections  *  
  1911. ' * for the current location if there is any!!                          *  
  1912. ' *                                                                     *  
  1913. ' * For example when you talk to Dizzy. This prevents you from dropping *
  1914. ' * any objects.                                                        *
  1915. ' ***********************************************************************  
  1916.  
  1917. If LOCATION_DETECTION_CHECKING_TRIGGERS(LOCATION)=1
  1918.  
  1919. CHECKED_DETECTION=0 : Rem We use this to check to see if a detection has been
  1920.  
  1921. Gosub "LOCATION_DETECTION"+Str$(LOCATION)-" "
  1922.  
  1923. If CHECKED_DETECTION=1 : Rem If a detection has been made then don't call the inventory window - just RETURN
  1924.  
  1925. Return 
  1926.  
  1927. End If 
  1928.  
  1929. End If 
  1930.  
  1931.  
  1932.  
  1933. Gosub CHECK_FOR_OBJECT
  1934.  
  1935.  
  1936. If POCKET(1)>0 and POCKET(2)>0 and POCKET(3)>0 and OBJECT_TO_BE_PICKED_UP>0
  1937.  
  1938. MESSAGE=Rnd(2)+1 : Gosub MESSAGE_PRINTER
  1939.  
  1940. Gosub MESSAGE_END
  1941.  
  1942. Return 
  1943.  
  1944. End If 
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950. For N=1 To 3
  1951.  
  1952. If POCKET(N)=0 : Rem Is POCKET N empty? 
  1953.  
  1954. POCKET(N)=OBJECT_TO_BE_PICKED_UP : Rem Tell the empty pocket what it should be holding
  1955.  
  1956. OBJECT_CURRENT_LOCATION(OBJECT_TO_BE_PICKED_UP)=255 : Rem Place the object in a non existent location - 255 - all objects in here are being carried! 
  1957.  
  1958. Exit : Rem Once we have filled the pocket we must exit the loop so that the object isn't put into another pocket as well
  1959.  
  1960. End If 
  1961.  
  1962. Next N
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977. WIDTH=240 : Rem Size of the message window 
  1978. HEIGHT=96 : Rem Heightof the message window
  1979. XOFFSET=32 : Rem The X position 
  1980. YOFFSET=12 : Rem The Y position 
  1981. Gosub MESSAGEWINDOW : Rem Jump to the routine that will Build the window 
  1982.  
  1983.  
  1984.  
  1985. For POCKET_NUMBER=1 To 3 : Rem This will check all three pockets! 
  1986.  
  1987. TY=(22+POCKET_NUMBER*22)+YOFFSET-30 : Rem The Y coardinate for the TEXT to be printed
  1988.  
  1989. If POCKET(POCKET_NUMBER)=0 : Rem Is the pocket empty? 
  1990.  
  1991. TEX$="NOTHING!" : Rem Text is NOTHING! 
  1992. TX=120+XOFFSET-((Len(TEX$)/2)*8) : Rem This line centres the room name up!!   
  1993. Gosub PTEXT : Rem Jump to the routine that will display the text 
  1994.  
  1995. 'If the pocket is NOT empty then do this instead:- 
  1996.  
  1997. Else 
  1998.  
  1999.  
  2000. TEX$=OBJECT_NAME$(POCKET(POCKET_NUMBER)) : Rem Get the object name
  2001. INVENTORY_Y_OFFSET=OBJECT_Y_OFFSET(POCKET(POCKET_NUMBER))/2 : Rem this will place the object perfectly in line with its name text
  2002.  
  2003. Paste Bob XOFFSET+34+OBJECT_X_OFFSET(POCKET(POCKET_NUMBER)),TY+INVENTORY_Y_OFFSET-2,OBJECT_SPRITE_IMAGE(POCKET(POCKET_NUMBER)) : Rem This draws the object graphic image in the window beside the text
  2004.  
  2005. TX=128+XOFFSET-((Len(TEX$)/2)*8) : Rem This line centres the room name up!!   
  2006.  
  2007. Gosub PTEXT : Rem Jump to the routine that will display the text 
  2008.  
  2009. End If 
  2010.  
  2011. Next POCKET_NUMBER : Rem Has all three pockets been done yet? if not - loop around again
  2012.  
  2013.  
  2014.  
  2015.  
  2016. TEX$="EXIT AND DON'T DROP"
  2017. TX=44+XOFFSET
  2018. TY=(22+POCKET_NUMBER*22)+YOFFSET-30
  2019. Gosub PTEXT
  2020.  
  2021.  
  2022. MESSAGE=4 : Gosub MESSAGE_PRINTER
  2023.  
  2024.  
  2025. HANDSY=4 : Rem Start the HANDS Y position at text line 4 in the INVENTORY window - IE start the hands at the EXIT AND DON'T DROP message
  2026.  
  2027. Sprite 10,170,100+HANDSY*22,88 : Rem Place the hand on the left hand side 
  2028. Sprite 11,405,100+HANDSY*22,89 : Rem Place the hand on the right hand side
  2029.  
  2030. Wait Vbl : Rem Give the sprites time to appear
  2031.  
  2032. Screen Swap : Wait Vbl : Rem Flip the double buffer screen so that we can see the MENU system that we have just setup 
  2033.  
  2034. Do 
  2035.  
  2036. Sprite 10,170,100+HANDSY*22,88 : Rem Place the hand on the left hand side 
  2037. Sprite 11,405,100+HANDSY*22,89 : Rem Place the hand on the right hand side
  2038.  
  2039. If Jup(1) and HANDSY>1 Then HANDSY=HANDSY-1 : Rem Move the hands up!!
  2040. If Jdown(1) and HANDSY<4 Then HANDSY=HANDSY+1 : Rem Move the hands down!!
  2041.  
  2042. If Fire(1) and HANDSY=1 Then If POCKET(HANDSY)>0 Then POCKET_EMPTIED=HANDSY : Exit : Rem Has object 1 been selected?
  2043. If Fire(1) and HANDSY=2 Then If POCKET(HANDSY)>0 Then POCKET_EMPTIED=HANDSY : Exit : Rem Has object 2 been selected?
  2044. If Fire(1) and HANDSY=3 Then If POCKET(HANDSY)>0 Then POCKET_EMPTIED=HANDSY : Exit : Rem Has object 3 been selected?
  2045.  
  2046. If Fire(1) and HANDSY=4 Then POCKET_EMPTIED=0 : Exit : Rem Has the EXIT AND DON'T DROP message been selected? 
  2047.  
  2048. Wait 5 : Rem This is the speed at which the hands move up and down at 
  2049.  
  2050. Loop 
  2051.  
  2052.  
  2053.  
  2054. If POCKET_EMPTIED>0 : Rem Is there a pocket to be emptied? 
  2055.  
  2056. PUZZLE_SOLVED=0
  2057.  
  2058. If LOCATION_PUZZLE_CHECKING_TRIGGERS(LOCATION)=1 : Rem Is there a PUZZLE on this screen?
  2059.  
  2060. Gosub "LOCATION_PUZZLE_CHECKING"+Str$(LOCATION)-" " : Rem Check out the PUZZLE 
  2061.  
  2062. End If 
  2063.  
  2064. If PUZZLE_SOLVED=0
  2065.  
  2066. OBJECT_CURRENT_LOCATION(POCKET(POCKET_EMPTIED))=LOCATION : Rem Place the object dropped in the current location 
  2067.  
  2068. WHERE_YOU_ARE_X=((CHARLIEX+10)/16)*16 : Rem Find out the X coardinate of the middle of Charlie on the screen to the nearest 16 pixels! 
  2069. WHERE_YOU_ARE_Y=((CHARLIEY+30)/16)*16 : Rem Find out the Y coardinate of Charlies feet to the nearest 16 pixels! 
  2070.  
  2071. OBJECT_CURRENT_X_COARDINATE(POCKET(POCKET_EMPTIED))=WHERE_YOU_ARE_X : Rem Place the Object to be dropped at Charlies X coardinates 
  2072. OBJECT_CURRENT_Y_COARDINATE(POCKET(POCKET_EMPTIED))=WHERE_YOU_ARE_Y : Rem Place the object to be dropped at Charlis Y coardinates
  2073.  
  2074. POCKET(POCKET_EMPTIED)=0 : Rem empty the pocket 
  2075.  
  2076. End If 
  2077.  
  2078. End If 
  2079.  
  2080.  
  2081.  
  2082. Gosub THE_LOCATION_PICTURE_MAKER : Rem Jump to the routine that will redraw the picture after the INVENTORY window disappears 
  2083.  
  2084. Sprite Off 10 : Sprite Off 11 : Rem Turn off the hands 
  2085.  
  2086. Unfreeze : Rem Unfreeze all the game action - IE restart all monsters and animating backgrounds 
  2087.  
  2088. Screen Copy 2 To 0 : Rem Redraw the background by copying the entire contents of screen 2 to screen 0 
  2089.  
  2090. Return : Rem Go back to where we were called from!
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113. CHECK_FOR_OBJECT:
  2114.  
  2115. WHERE_YOU_ARE_X=((CHARLIEX+10)/16)*16 : Rem Find out the X coardinate of the middle of Charlie on the screen to the nearest 16 pixels! 
  2116. WHERE_YOU_ARE_Y=((CHARLIEY+30)/16)*16 : Rem Find out the Y coardinate of Charlies feet to the nearest 16 pixels! 
  2117.  
  2118. OBJECT_TO_BE_PICKED_UP=0 : Rem Reset this variable  
  2119.  
  2120. For N=1 To AMOUNT_OF_OBJECTS : Rem We need to check through all the objects in the game to see if any of them are at Charlies feet! 
  2121.  
  2122.  
  2123. If OBJECT_CURRENT_LOCATION(N)=LOCATION
  2124.  
  2125. ' *************************  
  2126. ' * Check Charlie's feet! *
  2127. ' *************************
  2128.  
  2129. If OBJECT_CURRENT_X_COARDINATE(N)=WHERE_YOU_ARE_X and OBJECT_CURRENT_Y_COARDINATE(N)=WHERE_YOU_ARE_Y : Rem Is the object at the same coardinates as Charlie 
  2130.  
  2131. OBJECT_TO_BE_PICKED_UP=N : Rem This is the object to be picked up then
  2132.  
  2133. End If 
  2134.  
  2135. ' **************************************** 
  2136. ' * Check to the left of Charlie's feet! * 
  2137. ' **************************************** 
  2138.  
  2139. If OBJECT_TO_BE_PICKED_UP=0 and OBJECT_CURRENT_X_COARDINATE(N)=WHERE_YOU_ARE_X-16 and OBJECT_CURRENT_Y_COARDINATE(N)=WHERE_YOU_ARE_Y
  2140.  
  2141. OBJECT_TO_BE_PICKED_UP=N : Rem This is the object to be picked up then
  2142.  
  2143. End If 
  2144.  
  2145. ' *****************************************
  2146. ' * Check to the right of Charlie's feet! *  
  2147. ' *****************************************
  2148.  
  2149. If OBJECT_TO_BE_PICKED_UP=0 and OBJECT_CURRENT_X_COARDINATE(N)=WHERE_YOU_ARE_X+16 and OBJECT_CURRENT_Y_COARDINATE(N)=WHERE_YOU_ARE_Y
  2150.  
  2151. OBJECT_TO_BE_PICKED_UP=N : Rem This is the object to be picked up then
  2152.  
  2153. End If 
  2154.  
  2155. End If 
  2156.  
  2157. Next N : Rem Has all objects been checked? If not then continue the loop
  2158.  
  2159. Return : Rem Go back to where we were called from!
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175. ' ******************************************************   
  2176. ' * This next routine will draw a message window       *   
  2177. ' * any width, any height and position it anywhere     *   
  2178. ' * on the screen. All you have to do is give it the   * 
  2179. ' * following information:-                            * 
  2180. ' *                                                    * 
  2181. ' * WIDTH - This should be a number divisable by 16    * 
  2182. ' * It controls the width of the message window.       * 
  2183. ' *                                                    * 
  2184. ' * HEIGHT - This should be a number divisable by 16   * 
  2185. ' * It controls the height of the message window.      *     
  2186. ' *                                                    * 
  2187. ' * XOFFSET - Any number you want.                     * 
  2188. ' * This controls the X offset of the window on screen.*   
  2189. ' *                                                    * 
  2190. ' * YOFFSET - Any number you want.                     * 
  2191. ' * This controls the Y offset of the window on screen.* 
  2192. ' *                                                    * 
  2193. ' ****************************************************** 
  2194.  
  2195. MESSAGEWINDOW:
  2196.  
  2197. Cls 0,XOFFSET+9,YOFFSET+8 To XOFFSET+WIDTH-1+8,YOFFSET+HEIGHT : Rem This makes the BLACK page that all the text will be written on 
  2198.  
  2199.  
  2200. For N=0 To WIDTH-1 Step 16
  2201.  
  2202. Paste Bob(N+XOFFSET)+8,YOFFSET+1,44
  2203. Paste Bob(N+XOFFSET)+8,YOFFSET+HEIGHT,Vrev(44)
  2204.  
  2205. Next N
  2206.  
  2207.  
  2208. For N=0 To HEIGHT-1 Step 16
  2209.  
  2210. Paste Bob XOFFSET+2,N+YOFFSET+8,45
  2211. Paste Bob XOFFSET+WIDTH-2,N+YOFFSET+8,Hrev(45)
  2212.  
  2213. Next N
  2214.  
  2215.  
  2216. Paste Bob XOFFSET+1,YOFFSET,43 : Rem Top left 
  2217. Paste Bob XOFFSET+WIDTH-1+8,YOFFSET,43 : Rem Top right
  2218. Paste Bob XOFFSET+1,YOFFSET+HEIGHT,43 : Rem Bottom left
  2219. Paste Bob XOFFSET+WIDTH-1+8,YOFFSET+HEIGHT,43 : Rem Bottom right 
  2220.  
  2221. Return 
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237. ' ****************************************************************   
  2238. ' * Remember the PTEXT routine from issue one of the disk mag?   *   
  2239. ' * Well here it is again. I am using this routine to convert    *   
  2240. ' * all text in the game into a fancy graphic font stored in our *   
  2241. ' * Sprite bank! Stuff includes room names, object names and     * 
  2242. ' * all the messages that we have in the game. Just place your   * 
  2243. ' * piece of text in the variable TEX$ and give it an X and Y    * 
  2244. ' * coardinate on the screening using TX and TY and the routine  * 
  2245. ' * will take over!!                                             * 
  2246. ' **************************************************************** 
  2247.  
  2248. PTEXT:
  2249.  
  2250. _FONTSTART=46 : Rem This is the starting point of our font in the sprite bank! 
  2251.  
  2252. TWIDTH=8 : Rem This tells the routine the Xwidth of the graphics font you are using 
  2253.  
  2254. ' *************************************************************************  
  2255. ' * I have split this routine into two separate parts. All of the TEXT in *
  2256. ' * the game uses the above _FONTSTART=46 and TWIDTH=8 variables apart    *
  2257. ' * from the numbers used in the LIVES,SCORE and COINS variables. So when *
  2258. ' * we update these we just change the _FONTSTART and TWIDTH and call the *
  2259. ' * PTEXT2 routine instead. This keeps everything else compatible.        *
  2260. ' *************************************************************************
  2261.  
  2262. PTEXT2:
  2263.  
  2264. TEX$=Upper$(TEX$) : Rem Convert our piece of text into UPPERCASE (Capital) letters 
  2265.  
  2266. WHATLENGTH=Len(TEX$) : Rem this line finds the amount of characters that is in our message  
  2267.  
  2268. For N=1 To WHATLENGTH : Rem this tells the routine how many characters it has to print.  
  2269.  
  2270. TEX2$=Mid$(TEX$,N,1) : IMAGE=Asc(TEX2$) : Rem this bit converts the current letter into the number of the image in our sprite bank 
  2271.  
  2272. If IMAGE=33 Then IMAGE=76+19 : Rem !
  2273. If IMAGE=46 Then IMAGE=74+19 : Rem .
  2274. If IMAGE=39 Then IMAGE=72+19 : Rem '
  2275. If IMAGE=63 Then IMAGE=75+19 : Rem ?
  2276. If IMAGE=44 Then IMAGE=73+19 : Rem ,
  2277. If IMAGE=32 Then Paste Bob TX+(N*TWIDTH),TY,_FONTSTART+31 : Rem This finds the SPACE in your message 
  2278. If IMAGE<>32 and(IMAGE<48 or IMAGE>57) Then Paste Bob TX+(N*TWIDTH),TY,(IMAGE-64)+_FONTSTART-1 : Rem This finds the LETTERS in your message 
  2279. If(IMAGE>=48 and IMAGE<=57) Then Paste Bob TX+(N*TWIDTH),TY,IMAGE-21+_FONTSTART-27 : Rem This finds the NUMBERS in your message 
  2280.  
  2281. Next N : Rem have we reached the end of the message yet?
  2282.  
  2283. Return : Rem go back to the next command after where the routine was called from - IE the gosub PTEXT 
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292. ROOMNAMEPRINT:
  2293.  
  2294.  
  2295. NUMBEROFSPACES=20-Len(ROOMNAME$) : Rem this checks to see how long the roomname is - must be at least 20 characters in length!
  2296. ROOMNAME$=ROOMNAME$+Space$(NUMBEROFSPACES) : Rem If the roomname is less than 20 characters then add enough spaces to make it up to 20 characters!
  2297.  
  2298.  
  2299. TEX$=ROOMNAME$ : Rem Set the variable TEX$ to the same as ROOMNAME$ so that its compatible with the PTEXT routine   
  2300.  
  2301. Screen 1 : Rem All future output to screen 1
  2302.  
  2303. TX=116 : TY=13 : Rem Its Y coardinates are 17 
  2304.  
  2305. Gosub PTEXT : Rem go to the routine that prints it!! 
  2306.  
  2307. Screen 0 : Rem All future output to screen 0
  2308.  
  2309. Return 
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320. DISPLAY_OBJECTS_IN_LOCATION:
  2321.  
  2322. For N=1 To AMOUNT_OF_OBJECTS : Rem Go through all the objects in the game 
  2323.  
  2324. If OBJECT_CURRENT_LOCATION(N)=LOCATION : Rem Is object N in this location?
  2325.  
  2326. Paste Bob OBJECT_CURRENT_X_COARDINATE(N)+OBJECT_X_OFFSET(N),OBJECT_CURRENT_Y_COARDINATE(N)+OBJECT_Y_OFFSET(N),OBJECT_SPRITE_IMAGE(N) : Rem If it is then place it on the screen at the proper X and Y coardinates!  
  2327.  
  2328. End If 
  2329.  
  2330. Next N : Rem Continue the loop! 
  2331.  
  2332. Return : Rem Go back to where it was called from! 
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338. ' ***************************************************************
  2339. ' * This is a new routine that I have added. To get a message   *
  2340. ' * window onto the screen all we have to do is place the       *
  2341. ' * number of the message we want inside the variable           *
  2342. ' * MESSAGE. All we have to do then is gosub this routine which *
  2343. ' * will draw it on the screen according to the details in      *
  2344. ' * the message data.                                           *
  2345. ' ***************************************************************
  2346.  
  2347. MESSAGE_PRINTER:
  2348.  
  2349. Restore MESSAGE_DATA : Rem Tells AMOS to start reading DATA from this label 
  2350.  
  2351. For CURRENT_MESSAGE_BEING_READ=1 To MESSAGE
  2352.  
  2353. If CURRENT_MESSAGE_BEING_READ=MESSAGE Then Exit 
  2354.  
  2355. Read MESSAGE_NUMBER,WIDTH,HEIGHT,XOFFSET,YOFFSET
  2356.  
  2357. Repeat 
  2358.  
  2359. Read TX,TY,TEX$
  2360.  
  2361. Until TEX$="end"
  2362.  
  2363. Next CURRENT_MESSAGE_BEING_READ
  2364.  
  2365. ' ****************************************************************** 
  2366. ' * The above routine will find the actual position of the message * 
  2367. ' * data that we want. The routine below will get that data!       * 
  2368. ' ****************************************************************** 
  2369.  
  2370. Read MESSAGE_NUMBER,WIDTH,HEIGHT,XOFFSET,YOFFSET : Rem Get the information
  2371.  
  2372. Gosub MESSAGEWINDOW : Rem Draw the window
  2373.  
  2374. Repeat 
  2375.  
  2376. Read TX,TY,TEX$ : Rem Get each line of TEXT in the message 
  2377.  
  2378. TX=TX+XOFFSET
  2379. TY=TY+YOFFSET
  2380.  
  2381. If TEX$<>"end" Then Gosub PTEXT : Rem This will print the message TEXT 
  2382.  
  2383. Until TEX$="end"
  2384.  
  2385. Gosub MESSAGE_SHOW : Rem Show the message window and text on the screen!! 
  2386.  
  2387. Return 
  2388.  
  2389.  
  2390.  
  2391.  
  2392. ' *******************************************************************
  2393. ' * This MESSAGE_SHOW routine will show any messages on the screen. *
  2394. ' *******************************************************************
  2395.  
  2396.  
  2397. MESSAGE_SHOW:
  2398.  
  2399. If MESSAGE=4 Then Return 
  2400.  
  2401. Screen Swap : Wait Vbl : Rem Flip the hidden double buffered screen into view!
  2402.  
  2403. Screen Copy 2 To 0 : Rem This makes sure that the message window will disappear whenever it has been read!
  2404.  
  2405. Bob Draw : Rem Update all bobs! 
  2406.  
  2407. Wait 5 : Rem Wait for a bit 
  2408.  
  2409. Do 
  2410. Wait Vbl 
  2411. Exit If Fire(1) : Rem When fire is pressed then exit this loop 
  2412. Loop 
  2413.  
  2414. Return 
  2415.  
  2416.  
  2417. ' ******************************************************** 
  2418. ' * This routine takes care of removing the LAST message * 
  2419. ' * window placed on the screen.                         * 
  2420. ' ******************************************************** 
  2421.  
  2422. MESSAGE_END:
  2423.  
  2424. Wait 10 : Rem Wait for a bit 
  2425. Unfreeze : Rem Tell everything to switch back on again! 
  2426. Screen Copy 2 To 0 : Rem Redraw the game screen back to normal again! 
  2427. Return : Rem go back! 
  2428.  
  2429.  
  2430. ' **************************************************************** 
  2431. ' * The next three routines - UPDATE SCORE, LIVES and COINS just * 
  2432. ' * take care of printing their latest values onto the screen.   * 
  2433. ' **************************************************************** 
  2434.  
  2435. _UPDATE_SCORE:
  2436.  
  2437. Screen 1
  2438.  
  2439. NUMBER$=Right$("000000"+Mid$(Str$(_SCORE),2),6)
  2440. _FONTSTART=78
  2441. TWIDTH=8
  2442. TEX$=NUMBER$ : TX=118 : TY=38 : Gosub PTEXT2
  2443.  
  2444. Screen 0
  2445.  
  2446. Return 
  2447.  
  2448. _UPDATE_LIVES:
  2449.  
  2450. Screen 1
  2451.  
  2452. NUMBER$=Right$("00"+Mid$(Str$(LIVES),2),2)
  2453. _FONTSTART=78
  2454. TWIDTH=8
  2455. TEX$=NUMBER$ : TX=84 : TY=38 : Gosub PTEXT2
  2456.  
  2457. Screen 0
  2458.  
  2459. If LIVES=0
  2460.  
  2461. Freeze : Rem Freeze all the action
  2462. Bob Draw : Rem Update all bobs in their latest positions on the screen
  2463. MESSAGE=8 : Gosub MESSAGE_PRINTER
  2464. Gosub MESSAGE_END
  2465. Stop 
  2466.  
  2467. End If 
  2468.  
  2469. Return 
  2470.  
  2471. _UPDATE_COINS:
  2472.  
  2473. Screen 1
  2474.  
  2475. NUMBER$=Right$("00"+Mid$(Str$(COINS),2),2)
  2476. _FONTSTART=78
  2477. TWIDTH=8
  2478. TEX$=NUMBER$ : TX=257 : TY=38 : Gosub PTEXT2
  2479.  
  2480. Screen 0
  2481.  
  2482. Return 
  2483.  
  2484. ' *****************************************************
  2485. ' * This is the routine that updates Charlies energy! *
  2486. ' *****************************************************
  2487.  
  2488. _UPDATE_ENERGY:
  2489.  
  2490. If DIE>0 Then Return : Rem You can't lose energy if your dead!! 
  2491.  
  2492. Screen 1
  2493.  
  2494. Dec _AMOUNT_OF_ENERGY_LEFT : Rem Take some energy off him 
  2495.  
  2496. Paste Bob 195+_AMOUNT_OF_ENERGY_LEFT,38,25 : Rem This is the energy bar blanker - its just a 1 pixel wide blank line that overwrites the energy bar 
  2497.  
  2498. If _AMOUNT_OF_ENERGY_LEFT=0 Then DIE=1 : _AMOUNT_OF_ENERGY_LEFT=47 : Rem This is the bit that checks if Charlie is dead - ie no energy left!! 
  2499.  
  2500. Screen 0
  2501.  
  2502. Return